Commit 67e60689aa2d25c9efcafb0302f26b9391d64eb6
1 parent
8e2b3476
feat: ERP升级
1、回退财务代码
Showing
55 changed files
with
0 additions
and
7383 deletions
sql/dml_erp_bill_v2.sql deleted
100644 → 0
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(256) NOT NULL COMMENT '报关单url地址', | |
6 | - `back_refund_date` varchar(64) NOT null COMMENT '必须回款日期', | |
7 | - `deduct_amount` decimal(20,6) DEFAULT NULL COMMENT '发生扣款金额', | |
8 | - `deduct_url` varchar(256) NOT NULL COMMENT '扣款单url地址', | |
9 | - `actual_receivable_amount` decimal(20,6) DEFAULT NULL COMMENT '实际应收金额', | |
10 | - `actual_payed_amount1` decimal(20,6) DEFAULT NULL COMMENT '实际应付金额1', | |
11 | - `actual_payed_amount2` decimal(20,6) DEFAULT NULL COMMENT '实际应付金额2', | |
12 | - `actual_payed_amount3` decimal(20,6) DEFAULT NULL COMMENT '实际应付金额3', | |
13 | - `other_amount` decimal(20,6) DEFAULT NULL COMMENT '其他费用金额', | |
14 | - `status` INT NOT NULL COMMENT '总经理审核状态 0:待审核、1:审核通过,2:审核驳回', | |
15 | - `enable_flag` INT NOT NULL COMMENT '是否可用 10-可用 20-删除', | |
16 | - `create_time` DATETIME NOT NULL COMMENT '创建时间', | |
17 | - `create_by` varchar(64) NOT NULL COMMENT '创建人', | |
18 | - `modify_time` DATETIME DEFAULT NULL COMMENT '修改时间', | |
19 | - `modify_by` varchar(64) DEFAULT NULL COMMENT '修改人', | |
20 | - `version` INT DEFAULT NULL COMMENT '版本号--乐观锁预留字段', | |
21 | - PRIMARY KEY (`id`) | |
22 | -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='应收款账单表'; | |
23 | - | |
24 | -DROP TABLE IF EXISTS `invoice_bill_mapping`; | |
25 | -CREATE TABLE `invoice_bill_mapping` ( | |
26 | - `id` bigint NOT NULL AUTO_INCREMENT, | |
27 | - `invoice_no` varchar(64) NOT NULL COMMENT '发票单号', | |
28 | - `invoice_bill_id` bigint DEFAULT '0' COMMENT 'invoice账单id', | |
29 | - `order_id` bigint DEFAULT '0' COMMENT '订单id', | |
30 | - `enable_flag` INT NOT NULL COMMENT '是否可用 10-可用 20-删除', | |
31 | - `create_time` DATETIME NOT NULL COMMENT '创建时间', | |
32 | - `create_by` varchar(64) NOT NULL COMMENT '创建人', | |
33 | - `modify_time` DATETIME DEFAULT NULL COMMENT '修改时间', | |
34 | - `modify_by` varchar(64) DEFAULT NULL COMMENT '修改人', | |
35 | - `version` INT DEFAULT NULL COMMENT '版本号--乐观锁预留字段', | |
36 | - PRIMARY KEY (`id`) | |
37 | -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='应收款账单关联订单映射表'; | |
38 | - | |
39 | - | |
40 | -DROP TABLE IF EXISTS `produce_payment_check_bill_order`; | |
41 | -CREATE TABLE `produce_payment_check_bill_order` ( | |
42 | - `id` bigint NOT NULL AUTO_INCREMENT, | |
43 | - `check_no` varchar(64) NOT NULL COMMENT '生产科对账单', | |
44 | - `invoice_url` varchar(256) NOT NULL COMMENT '发票url地址', | |
45 | - `deduct_pdf_url` varchar(256) NOT NULL COMMENT '扣款单url地址', | |
46 | - `payed_date` varchar(64) NOT null COMMENT '生产科应付款日期', | |
47 | - `deduct_dept` varchar(64) NOT null COMMENT '生产科扣款责任部门', | |
48 | - `deduct_amount` decimal(20,6) DEFAULT NULL COMMENT '生产科扣款金额', | |
49 | - `actual_payed_amount` decimal(20,6) DEFAULT NULL COMMENT '实际应付金额', | |
50 | - `status` INT NOT NULL COMMENT '总经理审核状态 0:待审核、1:审核通过,2:审核驳回', | |
51 | - `enable_flag` INT NOT NULL COMMENT '是否可用 10-可用 20-删除', | |
52 | - `create_time` DATETIME NOT NULL COMMENT '创建时间', | |
53 | - `create_by` varchar(64) NOT NULL COMMENT '创建人', | |
54 | - `modify_time` DATETIME DEFAULT NULL COMMENT '修改时间', | |
55 | - `modify_by` varchar(64) DEFAULT NULL COMMENT '修改人', | |
56 | - `version` INT DEFAULT NULL COMMENT '版本号--乐观锁预留字段', | |
57 | - PRIMARY KEY (`id`) | |
58 | -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='生产科对账单应收账单'; | |
59 | - | |
60 | -DROP TABLE IF EXISTS `check_bill_mapping`; | |
61 | -CREATE TABLE `check_bill_mapping` ( | |
62 | - `id` bigint NOT NULL AUTO_INCREMENT, | |
63 | - `check_no` varchar(64) NOT NULL COMMENT '生产科对账单号', | |
64 | - `check_bill_id` bigint DEFAULT '0' COMMENT 'check账单id', | |
65 | - `order_id` bigint DEFAULT '0' COMMENT '订单id', | |
66 | - `enable_flag` INT NOT NULL COMMENT '是否可用 10-可用 20-删除', | |
67 | - `create_time` DATETIME NOT NULL COMMENT '创建时间', | |
68 | - `create_by` varchar(64) NOT NULL COMMENT '创建人', | |
69 | - `modify_time` DATETIME DEFAULT NULL COMMENT '修改时间', | |
70 | - `modify_by` varchar(64) DEFAULT NULL COMMENT '修改人', | |
71 | - `version` INT DEFAULT NULL COMMENT '版本号--乐观锁预留字段', | |
72 | - PRIMARY KEY (`id`) | |
73 | -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='生产科对账单应收账单映射表'; | |
74 | - |
src/main/java/com/order/erp/controller/InvoiceBillOrderController.java deleted
100644 → 0
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.*; | |
6 | -import com.order.erp.service.order.InvoiceBillOrderService; | |
7 | -import org.springframework.validation.annotation.Validated; | |
8 | -import org.springframework.web.bind.annotation.PostMapping; | |
9 | -import org.springframework.web.bind.annotation.RequestBody; | |
10 | -import org.springframework.web.bind.annotation.RequestMapping; | |
11 | -import org.springframework.web.bind.annotation.RestController; | |
12 | - | |
13 | -import javax.annotation.Resource; | |
14 | - | |
15 | -/** | |
16 | - * 应收款账单表(InvoiceBillOrder)表控制层 | |
17 | - * | |
18 | - * @author makejava | |
19 | - * @since 2024-08-05 16:26:34 | |
20 | - */ | |
21 | -@RestController | |
22 | -@RequestMapping("/order/erp/invoice_bill") | |
23 | -public class InvoiceBillOrderController { | |
24 | - /** | |
25 | - * 服务对象 | |
26 | - */ | |
27 | - @Resource | |
28 | - private InvoiceBillOrderService invoiceBillOrderService; | |
29 | - | |
30 | - /** | |
31 | - * 分页查询 | |
32 | - * | |
33 | - * @param invoiceBillOrderQueryVO 查询条件 | |
34 | - * @return 查询结果 | |
35 | - */ | |
36 | - @PostMapping("/list_by_page") | |
37 | - public ServerResult listByPage(@RequestBody @Validated({OperateGroup.List.class}) InvoiceBillOrderQueryVO invoiceBillOrderQueryVO) { | |
38 | - return invoiceBillOrderService.listByPage(invoiceBillOrderQueryVO); | |
39 | - } | |
40 | - | |
41 | - /** | |
42 | - * 基础订单查询 | |
43 | - * | |
44 | - * @param queryVO 查询条件 | |
45 | - * @return 查询结果 | |
46 | - */ | |
47 | - @PostMapping("/list_base_order_info_by") | |
48 | - public ServerResult listBaseOrderInfoBy(@RequestBody @Validated({OperateGroup.List.class}) InvoiceBaseOrderQueryVO queryVO) { | |
49 | - return invoiceBillOrderService.listBaseOrderInfoBy(queryVO); | |
50 | - } | |
51 | - | |
52 | - | |
53 | - /** | |
54 | - * 创建invoice单据 | |
55 | - * | |
56 | - * @param createVO 数据VO | |
57 | - * @return 新增结果 | |
58 | - */ | |
59 | - @PostMapping("/create") | |
60 | - public ServerResult create(@RequestBody InvoiceBillCreateVO createVO) { | |
61 | - return invoiceBillOrderService.create(createVO); | |
62 | - } | |
63 | - | |
64 | - /** | |
65 | - * 更新扣款信息 | |
66 | - * | |
67 | - * @param deductInfoVO 数据VO | |
68 | - * @return 编辑结果 | |
69 | - */ | |
70 | - @PostMapping("/update_deduct_info") | |
71 | - public ServerResult updateDeductInfo(@RequestBody InvoiceBillDeductInfoVO deductInfoVO) { | |
72 | - return invoiceBillOrderService.updateDeductInfo(deductInfoVO); | |
73 | - } | |
74 | - | |
75 | - /** | |
76 | - * 更新其他金额信息 | |
77 | - * | |
78 | - * @param amountInfoVO 数据VO | |
79 | - * @return 编辑结果 | |
80 | - */ | |
81 | - @PostMapping("/update_amount_info") | |
82 | - public ServerResult updateAmountInfo(@RequestBody InvoiceBillAmountInfoVO amountInfoVO) { | |
83 | - return invoiceBillOrderService.updateAmountInfo(amountInfoVO); | |
84 | - } | |
85 | - | |
86 | - /** | |
87 | - * 删除数据 | |
88 | - * | |
89 | - * @param invoiceBillOrderQueryVO 查询条件 | |
90 | - * @return 删除是否成功 | |
91 | - */ | |
92 | - @PostMapping("/delete_by_id") | |
93 | - public ServerResult deleteById(@RequestBody InvoiceBillOrderQueryVO invoiceBillOrderQueryVO) { | |
94 | - return invoiceBillOrderService.deleteById(invoiceBillOrderQueryVO); | |
95 | - } | |
96 | - | |
97 | -} | |
98 | - |
src/main/java/com/order/erp/controller/ProducePaymentCheckBillOrderController.java deleted
100644 → 0
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/domain/dto/order/CheckBillMappingDO.java deleted
100644 → 0
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 deleted
100644 → 0
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 deleted
100644 → 0
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 BigDecimal deductAmount; | |
43 | - /** | |
44 | - * 扣款单url地址 | |
45 | - */ | |
46 | - private String deductUrl; | |
47 | - /** | |
48 | - * 实际应收金额 | |
49 | - */ | |
50 | - private BigDecimal actualReceivableAmount; | |
51 | - /** | |
52 | - * 实际应付金额1 | |
53 | - */ | |
54 | - private BigDecimal actualPayedAmount1; | |
55 | - /** | |
56 | - * 实际应付金额2 | |
57 | - */ | |
58 | - private BigDecimal actualPayedAmount2; | |
59 | - /** | |
60 | - * 实际应付金额3 | |
61 | - */ | |
62 | - private BigDecimal actualPayedAmount3; | |
63 | - /** | |
64 | - * 其他费用金额 | |
65 | - */ | |
66 | - private BigDecimal otherAmount; | |
67 | - /** | |
68 | - * 总经理审核状态 0:待审核、1:审核通过,2:审核驳回 | |
69 | - */ | |
70 | - private Integer status; | |
71 | - | |
72 | -} |
src/main/java/com/order/erp/domain/dto/order/ProducePaymentCheckBillOrderDO.java deleted
100644 → 0
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/order/CheckBillMappingQueryVO.java deleted
100644 → 0
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 deleted
100644 → 0
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 deleted
100644 → 0
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 deleted
100644 → 0
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/InvoiceBillCreateVO.java deleted
100644 → 0
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 deleted
100644 → 0
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 deleted
100644 → 0
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 deleted
100644 → 0
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 deleted
100644 → 0
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 | - * 总经理审核状态 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 | - |
src/main/java/com/order/erp/domain/vo/order/InvoiceBillOrderVO.java deleted
100644 → 0
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/ProducePaymentCheckBillOrderQueryVO.java deleted
100644 → 0
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 deleted
100644 → 0
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/mapper/order/CheckBillMappingMapper.java deleted
100644 → 0
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 deleted
100644 → 0
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 deleted
100644 → 0
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/ProducePaymentCheckBillOrderMapper.java deleted
100644 → 0
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/service/order/CheckBillMappingService.java deleted
100644 → 0
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/EmailTemplateService.java deleted
100644 → 0
1 | -package com.order.erp.service.order; | |
2 | - | |
3 | -import com.baomidou.mybatisplus.extension.service.IService; | |
4 | -import com.order.erp.common.constant.ServerResult; | |
5 | -import com.order.erp.domain.dto.order.EmailTemplateDO; | |
6 | -import com.order.erp.domain.vo.order.EmailTemplateQueryVO; | |
7 | -import com.order.erp.domain.vo.order.EmailTemplateVO; | |
8 | - | |
9 | -/** | |
10 | - * 邮件模板表(EmailTemplate)表服务接口 | |
11 | - * | |
12 | - * @author makejava | |
13 | - * @since 2024-07-03 10:58:27 | |
14 | - */ | |
15 | -public interface EmailTemplateService extends IService<EmailTemplateDO> { | |
16 | - | |
17 | - /** | |
18 | - * 通过ID查询单条数据 | |
19 | - * | |
20 | - * @param emailTemplateQueryVO 主键 | |
21 | - * @return 实例对象 | |
22 | - */ | |
23 | - ServerResult queryById(EmailTemplateQueryVO emailTemplateQueryVO); | |
24 | - | |
25 | - /** | |
26 | - * 分页查询 | |
27 | - * | |
28 | - * @param emailTemplateQueryVO 筛选条件 | |
29 | - * @return 查询结果 | |
30 | - */ | |
31 | - ServerResult list(EmailTemplateQueryVO emailTemplateQueryVO); | |
32 | - | |
33 | - /** | |
34 | - * 新增数据 | |
35 | - * | |
36 | - * @param emailTemplateVO 数据VO | |
37 | - * @return 新增结果 | |
38 | - */ | |
39 | - ServerResult add(EmailTemplateVO emailTemplateVO); | |
40 | - | |
41 | - /** | |
42 | - * 修改数据 | |
43 | - * | |
44 | - * @param emailTemplateVO 数据VO | |
45 | - * @return 编辑结果 | |
46 | - */ | |
47 | - ServerResult edit(EmailTemplateVO emailTemplateVO); | |
48 | - | |
49 | - /** | |
50 | - * 通过主键删除数据 | |
51 | - * | |
52 | - * @param emailTemplateQueryVO 筛选条件 | |
53 | - * @return 是否成功 | |
54 | - */ | |
55 | - ServerResult deleteById(EmailTemplateQueryVO emailTemplateQueryVO); | |
56 | - | |
57 | -} |
src/main/java/com/order/erp/service/order/InvoiceBillMappingService.java deleted
100644 → 0
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 deleted
100644 → 0
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 | -/** | |
9 | - * 应收款账单表(InvoiceBillOrder)表服务接口 | |
10 | - * | |
11 | - * @author makejava | |
12 | - * @since 2024-08-05 16:26:34 | |
13 | - */ | |
14 | -public interface InvoiceBillOrderService extends IService<InvoiceBillOrderDO> { | |
15 | - | |
16 | - /** | |
17 | - * 分页查询 | |
18 | - * | |
19 | - * @param invoiceBillOrderQueryVO 筛选条件 | |
20 | - * @return 查询结果 | |
21 | - */ | |
22 | - ServerResult listByPage(InvoiceBillOrderQueryVO invoiceBillOrderQueryVO); | |
23 | - | |
24 | - /** | |
25 | - * @param queryVO | |
26 | - * @return | |
27 | - */ | |
28 | - ServerResult listBaseOrderInfoBy(InvoiceBaseOrderQueryVO queryVO); | |
29 | - | |
30 | - /** | |
31 | - * 新增数据 | |
32 | - * | |
33 | - * @param createVO 数据VO | |
34 | - * @return 新增结果 | |
35 | - */ | |
36 | - ServerResult create(InvoiceBillCreateVO createVO); | |
37 | - | |
38 | - /** | |
39 | - * 更新扣款信息 | |
40 | - * | |
41 | - * @param deductInfoVO 数据VO | |
42 | - * @return 编辑结果 | |
43 | - */ | |
44 | - ServerResult updateDeductInfo(InvoiceBillDeductInfoVO deductInfoVO); | |
45 | - | |
46 | - /** | |
47 | - * 更新其他金额信息 | |
48 | - * | |
49 | - * @param amountInfoVO | |
50 | - * @return | |
51 | - */ | |
52 | - ServerResult updateAmountInfo(InvoiceBillAmountInfoVO amountInfoVO); | |
53 | - | |
54 | - /** | |
55 | - * 通过主键删除数据 | |
56 | - * | |
57 | - * @param invoiceBillOrderQueryVO 筛选条件 | |
58 | - * @return 是否成功 | |
59 | - */ | |
60 | - ServerResult deleteById(InvoiceBillOrderQueryVO invoiceBillOrderQueryVO); | |
61 | - | |
62 | -} |
src/main/java/com/order/erp/service/order/OrderAuditLogService.java deleted
100644 → 0
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.OrderAuditLogDO; | |
6 | -import com.order.erp.domain.vo.order.OrderAuditLogQueryVO; | |
7 | -import com.order.erp.domain.vo.order.OrderAuditLogVO; | |
8 | - | |
9 | -import java.util.List; | |
10 | - | |
11 | -/** | |
12 | - * 用户订单审批日志表(OrderAuditLog)表服务接口 | |
13 | - * | |
14 | - * @author makejava | |
15 | - * @since 2023-09-08 15:26:42 | |
16 | - */ | |
17 | -public interface OrderAuditLogService extends IService<OrderAuditLogDO> { | |
18 | - | |
19 | - /** | |
20 | - * 通过ID查询单条数据 | |
21 | - * | |
22 | - * @param orderAuditLogQueryVO 主键 | |
23 | - * @return 实例对象 | |
24 | - */ | |
25 | - ServerResult queryById(OrderAuditLogQueryVO orderAuditLogQueryVO); | |
26 | - | |
27 | - /** | |
28 | - * 分页查询 | |
29 | - * | |
30 | - * @param orderAuditLogQueryVO 筛选条件 | |
31 | - * @return 查询结果 | |
32 | - */ | |
33 | - ServerResult list(OrderAuditLogQueryVO orderAuditLogQueryVO); | |
34 | - | |
35 | - | |
36 | - /** | |
37 | - * | |
38 | - * @param queryVO | |
39 | - * @return | |
40 | - */ | |
41 | - ServerResult listByPage(OrderAuditLogQueryVO queryVO); | |
42 | - | |
43 | - /** | |
44 | - * 新增数据 | |
45 | - * | |
46 | - * @param orderAuditLogVO 数据VO | |
47 | - * @return 新增结果 | |
48 | - */ | |
49 | - ServerResult add(OrderAuditLogVO orderAuditLogVO); | |
50 | - | |
51 | - /** | |
52 | - * 修改数据 | |
53 | - * | |
54 | - * @param orderAuditLogVO 数据VO | |
55 | - * @return 编辑结果 | |
56 | - */ | |
57 | - ServerResult edit(OrderAuditLogVO orderAuditLogVO); | |
58 | - | |
59 | - /** | |
60 | - * 通过主键删除数据 | |
61 | - * | |
62 | - * @param orderAuditLogQueryVO 筛选条件 | |
63 | - * @return 是否成功 | |
64 | - */ | |
65 | - ServerResult deleteById(OrderAuditLogQueryVO orderAuditLogQueryVO); | |
66 | - | |
67 | - boolean deleteByOrderId(Long getId); | |
68 | - | |
69 | - boolean deleteByOrderIds(List<Long> orderIds); | |
70 | -} |
src/main/java/com/order/erp/service/order/OrderBaseInfoService.java deleted
100644 → 0
1 | -package com.order.erp.service.order; | |
2 | - | |
3 | -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | |
4 | -import com.baomidou.mybatisplus.extension.service.IService; | |
5 | -import com.order.erp.common.constant.ServerResult; | |
6 | -import com.order.erp.common.excel4j.exceptions.Excel4JException; | |
7 | -import com.order.erp.domain.dto.order.OrderBaseInfoDO; | |
8 | -import com.order.erp.domain.vo.order.*; | |
9 | - | |
10 | -import javax.servlet.http.HttpServletResponse; | |
11 | -import java.io.IOException; | |
12 | -import java.util.List; | |
13 | -import java.util.Map; | |
14 | - | |
15 | -/** | |
16 | - * 订单基础信息表(OrderBaseInfo)表服务接口 | |
17 | - * | |
18 | - * @author makejava | |
19 | - * @since 2023-09-08 15:26:43 | |
20 | - */ | |
21 | -public interface OrderBaseInfoService extends IService<OrderBaseInfoDO> { | |
22 | - | |
23 | - /** | |
24 | - * | |
25 | - * @param queryVO | |
26 | - * @return | |
27 | - */ | |
28 | - LambdaQueryWrapper<OrderBaseInfoDO> buildQueryByParam(OrderBaseInfoQueryVO queryVO); | |
29 | - | |
30 | - /** | |
31 | - * 通过ID查询单条数据 | |
32 | - * | |
33 | - * @param orderBaseInfoQueryVO 主键 | |
34 | - * @return 实例对象 | |
35 | - */ | |
36 | - ServerResult queryById(OrderBaseInfoQueryVO orderBaseInfoQueryVO); | |
37 | - | |
38 | - /** | |
39 | - * 分页查询 | |
40 | - * | |
41 | - * @param orderBaseInfoQueryVO 筛选条件 | |
42 | - * @return 查询结果 | |
43 | - */ | |
44 | - ServerResult list(OrderBaseInfoQueryVO orderBaseInfoQueryVO); | |
45 | - | |
46 | - /** | |
47 | - * @param orderBaseInfoDOList | |
48 | - * @return | |
49 | - */ | |
50 | - List<OrderInfoResultVO> wrapperOrderResultList(Boolean locked, List<OrderBaseInfoDO> orderBaseInfoDOList); | |
51 | - | |
52 | - /** | |
53 | - * @param orderBaseInfoQueryVO | |
54 | - * @return | |
55 | - */ | |
56 | - ServerResult listByPage(OrderBaseInfoQueryVO orderBaseInfoQueryVO); | |
57 | - | |
58 | - /** | |
59 | - * 校验是否重复 | |
60 | - * @param orderBaseInfoQueryVO | |
61 | - * @return | |
62 | - */ | |
63 | - ServerResult check(OrderBaseInfoQueryVO orderBaseInfoQueryVO); | |
64 | - | |
65 | - /** | |
66 | - * @param response | |
67 | - * @param orderBaseInfoQueryVO | |
68 | - * @return | |
69 | - */ | |
70 | - void export(HttpServletResponse response, OrderBaseInfoQueryVO orderBaseInfoQueryVO) throws IOException, Excel4JException; | |
71 | - | |
72 | - /** | |
73 | - * @param fieldVO | |
74 | - * @return | |
75 | - */ | |
76 | - ServerResult fieldUnlockApply(OrderUnlockFieldApplyVO fieldVO); | |
77 | - | |
78 | - /** | |
79 | - * 新增数据 | |
80 | - * | |
81 | - * @param orderAddVO 数据VO | |
82 | - * @return 新增结果 | |
83 | - */ | |
84 | - ServerResult add(OrderAddVO orderAddVO); | |
85 | - | |
86 | - /** | |
87 | - * 修改数据 | |
88 | - * | |
89 | - * @param updateVO 数据VO | |
90 | - * @return 编辑结果 | |
91 | - */ | |
92 | - ServerResult edit(OrderUpdateVO updateVO); | |
93 | - | |
94 | - /** | |
95 | - * 通过主键删除数据 | |
96 | - * | |
97 | - * @param orderBaseInfoQueryVO 筛选条件 | |
98 | - * @return 是否成功 | |
99 | - */ | |
100 | - ServerResult deleteById(OrderBaseInfoQueryVO orderBaseInfoQueryVO); | |
101 | - | |
102 | - long countByOrderStatus(Integer orderFinish); | |
103 | - | |
104 | - long countRecentMonthByOrderStatus(Integer orderFinish); | |
105 | - | |
106 | - | |
107 | - List<Map<String, Integer>> countDaysOrder(); | |
108 | - | |
109 | - long countAll(); | |
110 | - | |
111 | - long countRecentYear(); | |
112 | - | |
113 | - ServerResult checkChargeOrderCount(List<Long> orderIds); | |
114 | -} |
src/main/java/com/order/erp/service/order/OrderCompletionReportService.java deleted
100644 → 0
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.common.excel4j.exceptions.Excel4JException; | |
6 | -import com.order.erp.domain.dto.order.OrderCompletionReportDO; | |
7 | -import com.order.erp.domain.vo.OrderReportAnalysisVo; | |
8 | -import com.order.erp.domain.vo.order.OrderBaseInfoQueryVO; | |
9 | -import com.order.erp.domain.vo.order.OrderCompletionReportQueryVO; | |
10 | -import com.order.erp.domain.vo.order.OrderCompletionReportVO; | |
11 | - | |
12 | -import javax.servlet.http.HttpServletResponse; | |
13 | -import java.io.IOException; | |
14 | -import java.util.List; | |
15 | - | |
16 | -/** | |
17 | - * 订单-项目完成报告书(OrderCompletionReport)表服务接口 | |
18 | - * | |
19 | - * @author makejava | |
20 | - * @since 2023-09-08 15:26:44 | |
21 | - */ | |
22 | -public interface OrderCompletionReportService extends IService<OrderCompletionReportDO> { | |
23 | - | |
24 | - /** | |
25 | - * 通过ID查询单条数据 | |
26 | - * | |
27 | - * @param orderCompletionReportQueryVO 主键 | |
28 | - * @return 实例对象 | |
29 | - */ | |
30 | - ServerResult queryById(OrderCompletionReportQueryVO orderCompletionReportQueryVO); | |
31 | - | |
32 | - /** | |
33 | - * 分页查询 | |
34 | - * | |
35 | - * @param orderCompletionReportQueryVO 筛选条件 | |
36 | - * @return 查询结果 | |
37 | - */ | |
38 | - ServerResult list(OrderCompletionReportQueryVO orderCompletionReportQueryVO); | |
39 | - | |
40 | - | |
41 | - /** | |
42 | - * @param queryVO | |
43 | - * @return | |
44 | - */ | |
45 | - ServerResult analysis(OrderBaseInfoQueryVO queryVO); | |
46 | - | |
47 | - /** | |
48 | - * | |
49 | - * @param response | |
50 | - * @param orderBaseInfoQueryVO | |
51 | - * @return | |
52 | - */ | |
53 | - ServerResult export(HttpServletResponse response, OrderBaseInfoQueryVO orderBaseInfoQueryVO) throws IOException, Excel4JException; | |
54 | - | |
55 | - /** | |
56 | - * 新增数据 | |
57 | - * | |
58 | - * @param orderCompletionReportVO 数据VO | |
59 | - * @return 新增结果 | |
60 | - */ | |
61 | - ServerResult add(OrderCompletionReportVO orderCompletionReportVO); | |
62 | - | |
63 | - /** | |
64 | - * 修改数据 | |
65 | - * | |
66 | - * @param orderCompletionReportVO 数据VO | |
67 | - * @return 编辑结果 | |
68 | - */ | |
69 | - ServerResult edit(OrderCompletionReportVO orderCompletionReportVO); | |
70 | - | |
71 | - /** | |
72 | - * 通过主键删除数据 | |
73 | - * | |
74 | - * @param orderCompletionReportQueryVO 筛选条件 | |
75 | - * @return 是否成功 | |
76 | - */ | |
77 | - ServerResult deleteById(OrderCompletionReportQueryVO orderCompletionReportQueryVO); | |
78 | - | |
79 | - boolean deleteByOrderId(Long orderId); | |
80 | - | |
81 | - boolean deleteByOrderIds(List<Long> orderIds); | |
82 | - | |
83 | - long countByOrderStatus(Integer status); | |
84 | - | |
85 | - long countYearByOrderStatus(Integer status); | |
86 | -} |
src/main/java/com/order/erp/service/order/OrderFieldLockApplyService.java deleted
100644 → 0
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.OrderFieldLockApplyDO; | |
6 | -import com.order.erp.domain.vo.order.AuditVO; | |
7 | -import com.order.erp.domain.vo.order.OrderFieldLockApplyQueryVO; | |
8 | -import com.order.erp.domain.vo.order.OrderFieldLockApplyVO; | |
9 | - | |
10 | -import java.util.List; | |
11 | - | |
12 | -/** | |
13 | - * 用户订单-字段锁定申请表(OrderFieldLockApply)表服务接口 | |
14 | - * | |
15 | - * @author makejava | |
16 | - * @since 2023-09-08 15:26:45 | |
17 | - */ | |
18 | -public interface OrderFieldLockApplyService extends IService<OrderFieldLockApplyDO> { | |
19 | - | |
20 | - /** | |
21 | - * 通过ID查询单条数据 | |
22 | - * | |
23 | - * @param orderFieldLockApplyQueryVO 主键 | |
24 | - * @return 实例对象 | |
25 | - */ | |
26 | - ServerResult queryById(OrderFieldLockApplyQueryVO orderFieldLockApplyQueryVO); | |
27 | - | |
28 | - /** | |
29 | - * 分页查询 | |
30 | - * | |
31 | - * @param orderFieldLockApplyQueryVO 筛选条件 | |
32 | - * @return 查询结果 | |
33 | - */ | |
34 | - ServerResult list(OrderFieldLockApplyQueryVO orderFieldLockApplyQueryVO); | |
35 | - | |
36 | - /** | |
37 | - * @param orderFieldLockApplyQueryVO | |
38 | - * @return | |
39 | - */ | |
40 | - ServerResult listByPage(OrderFieldLockApplyQueryVO orderFieldLockApplyQueryVO); | |
41 | - | |
42 | - /** | |
43 | - * 新增数据 | |
44 | - * | |
45 | - * @param orderFieldLockApplyVO 数据VO | |
46 | - * @return 新增结果 | |
47 | - */ | |
48 | - ServerResult add(OrderFieldLockApplyVO orderFieldLockApplyVO); | |
49 | - | |
50 | - /** | |
51 | - * @param auditVO | |
52 | - * @return | |
53 | - */ | |
54 | - ServerResult doAudit(AuditVO auditVO); | |
55 | - | |
56 | - /** | |
57 | - * 修改数据 | |
58 | - * | |
59 | - * @param orderFieldLockApplyVO 数据VO | |
60 | - * @return 编辑结果 | |
61 | - */ | |
62 | - ServerResult edit(OrderFieldLockApplyVO orderFieldLockApplyVO); | |
63 | - | |
64 | - /** | |
65 | - * 通过主键删除数据 | |
66 | - * | |
67 | - * @param orderFieldLockApplyQueryVO 筛选条件 | |
68 | - * @return 是否成功 | |
69 | - */ | |
70 | - ServerResult deleteById(OrderFieldLockApplyQueryVO orderFieldLockApplyQueryVO); | |
71 | - | |
72 | - boolean deleteByOrderId(Long orderId); | |
73 | - | |
74 | - boolean deleteByOrderIds(List<Long> orderIds); | |
75 | -} |
src/main/java/com/order/erp/service/order/OrderFieldLockRecordService.java deleted
100644 → 0
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.OrderFieldLockRecordDO; | |
6 | -import com.order.erp.domain.vo.order.OrderFieldLockRecordQueryVO; | |
7 | -import com.order.erp.domain.vo.order.OrderFieldLockRecordVO; | |
8 | - | |
9 | -import java.util.List; | |
10 | - | |
11 | -/** | |
12 | - * 用户订单-字段锁定记录表(OrderFieldLockRecord)表服务接口 | |
13 | - * | |
14 | - * @author makejava | |
15 | - * @since 2023-09-08 15:26:45 | |
16 | - */ | |
17 | -public interface OrderFieldLockRecordService extends IService<OrderFieldLockRecordDO> { | |
18 | - | |
19 | - /** | |
20 | - * 通过ID查询单条数据 | |
21 | - * | |
22 | - * @param orderFieldLockRecordQueryVO 主键 | |
23 | - * @return 实例对象 | |
24 | - */ | |
25 | - ServerResult queryById(OrderFieldLockRecordQueryVO orderFieldLockRecordQueryVO); | |
26 | - | |
27 | - /** | |
28 | - * 分页查询 | |
29 | - * | |
30 | - * @param orderFieldLockRecordQueryVO 筛选条件 | |
31 | - * @return 查询结果 | |
32 | - */ | |
33 | - ServerResult list(OrderFieldLockRecordQueryVO orderFieldLockRecordQueryVO); | |
34 | - | |
35 | - /** | |
36 | - * 新增数据 | |
37 | - * | |
38 | - * @param orderFieldLockRecordVO 数据VO | |
39 | - * @return 新增结果 | |
40 | - */ | |
41 | - ServerResult add(OrderFieldLockRecordVO orderFieldLockRecordVO); | |
42 | - | |
43 | - /** | |
44 | - * 修改数据 | |
45 | - * | |
46 | - * @param orderFieldLockRecordVO 数据VO | |
47 | - * @return 编辑结果 | |
48 | - */ | |
49 | - ServerResult edit(OrderFieldLockRecordVO orderFieldLockRecordVO); | |
50 | - | |
51 | - /** | |
52 | - * 通过主键删除数据 | |
53 | - * | |
54 | - * @param orderFieldLockRecordQueryVO 筛选条件 | |
55 | - * @return 是否成功 | |
56 | - */ | |
57 | - ServerResult deleteById(OrderFieldLockRecordQueryVO orderFieldLockRecordQueryVO); | |
58 | - | |
59 | - boolean deleteByOrderId(Long orderId); | |
60 | - | |
61 | - boolean deleteByOrderIds(List<Long> orderIds); | |
62 | -} |
src/main/java/com/order/erp/service/order/OrderInspectionStageService.java deleted
100644 → 0
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.OrderStatusEnum; | |
6 | -import com.order.erp.domain.dto.order.OrderInspectionStageDO; | |
7 | -import com.order.erp.domain.vo.order.OrderInspectionStageQueryVO; | |
8 | -import com.order.erp.domain.vo.order.OrderInspectionStageVO; | |
9 | - | |
10 | -import java.util.List; | |
11 | - | |
12 | -/** | |
13 | - * 订单-质检环节(OrderInspectionStage)表服务接口 | |
14 | - * | |
15 | - * @author makejava | |
16 | - * @since 2023-09-08 15:26:46 | |
17 | - */ | |
18 | -public interface OrderInspectionStageService extends IService<OrderInspectionStageDO> { | |
19 | - | |
20 | - /** | |
21 | - * 通过ID查询单条数据 | |
22 | - * | |
23 | - * @param orderInspectionStageQueryVO 主键 | |
24 | - * @return 实例对象 | |
25 | - */ | |
26 | - ServerResult queryById(OrderInspectionStageQueryVO orderInspectionStageQueryVO); | |
27 | - | |
28 | - /** | |
29 | - * 分页查询 | |
30 | - * | |
31 | - * @param orderInspectionStageQueryVO 筛选条件 | |
32 | - * @return 查询结果 | |
33 | - */ | |
34 | - ServerResult list(OrderInspectionStageQueryVO orderInspectionStageQueryVO); | |
35 | - | |
36 | - /** | |
37 | - * 新增数据 | |
38 | - * | |
39 | - * @param orderInspectionStageVO 数据VO | |
40 | - * @return 新增结果 | |
41 | - */ | |
42 | - ServerResult add(OrderInspectionStageVO orderInspectionStageVO); | |
43 | - | |
44 | - /** | |
45 | - * 修改数据 | |
46 | - * | |
47 | - * @param orderInspectionStageVO 数据VO | |
48 | - * @return 编辑结果 | |
49 | - */ | |
50 | - ServerResult edit(OrderInspectionStageVO orderInspectionStageVO); | |
51 | - | |
52 | - /** | |
53 | - * 通过主键删除数据 | |
54 | - * | |
55 | - * @param orderInspectionStageQueryVO 筛选条件 | |
56 | - * @return 是否成功 | |
57 | - */ | |
58 | - ServerResult deleteById(OrderInspectionStageQueryVO orderInspectionStageQueryVO); | |
59 | - | |
60 | - boolean deleteByOrderId(Long orderId); | |
61 | - | |
62 | - boolean deleteByOrderIds(List<Long> orderIds); | |
63 | - | |
64 | - long countByOrderStatus(Integer orderStatus); | |
65 | - | |
66 | - long countRecentMonthByOrderStatus(Integer status); | |
67 | -} |
src/main/java/com/order/erp/service/order/OrderOptLogService.java deleted
100644 → 0
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.OrderOptLogDO; | |
6 | -import com.order.erp.domain.vo.order.OrderOptLogQueryVO; | |
7 | -import com.order.erp.domain.vo.order.OrderOptLogVO; | |
8 | - | |
9 | -import java.util.List; | |
10 | - | |
11 | -/** | |
12 | - * 用户订单操作日志表(OrderOptLog)表服务接口 | |
13 | - * | |
14 | - * @author makejava | |
15 | - * @since 2023-09-08 15:26:46 | |
16 | - */ | |
17 | -public interface OrderOptLogService extends IService<OrderOptLogDO> { | |
18 | - | |
19 | - /** | |
20 | - * 通过ID查询单条数据 | |
21 | - * | |
22 | - * @param orderOptLogQueryVO 主键 | |
23 | - * @return 实例对象 | |
24 | - */ | |
25 | - ServerResult queryById(OrderOptLogQueryVO orderOptLogQueryVO); | |
26 | - | |
27 | - /** | |
28 | - * 分页查询 | |
29 | - * | |
30 | - * @param orderOptLogQueryVO 筛选条件 | |
31 | - * @return 查询结果 | |
32 | - */ | |
33 | - ServerResult list(OrderOptLogQueryVO orderOptLogQueryVO); | |
34 | - | |
35 | - /** | |
36 | - * | |
37 | - * @param orderOptLogQueryVO | |
38 | - * @return | |
39 | - */ | |
40 | - ServerResult listByPage(OrderOptLogQueryVO orderOptLogQueryVO); | |
41 | - | |
42 | - /** | |
43 | - * 新增数据 | |
44 | - * | |
45 | - * @param orderOptLogVO 数据VO | |
46 | - * @return 新增结果 | |
47 | - */ | |
48 | - ServerResult add(OrderOptLogVO orderOptLogVO); | |
49 | - | |
50 | - /** | |
51 | - * 修改数据 | |
52 | - * | |
53 | - * @param orderOptLogVO 数据VO | |
54 | - * @return 编辑结果 | |
55 | - */ | |
56 | - ServerResult edit(OrderOptLogVO orderOptLogVO); | |
57 | - | |
58 | - /** | |
59 | - * 通过主键删除数据 | |
60 | - * | |
61 | - * @param orderOptLogQueryVO 筛选条件 | |
62 | - * @return 是否成功 | |
63 | - */ | |
64 | - ServerResult deleteById(OrderOptLogQueryVO orderOptLogQueryVO); | |
65 | - | |
66 | - boolean deleteByOrderId(Long orderId); | |
67 | - | |
68 | - boolean deleteByOrderIds(List<Long> orderIds); | |
69 | -} |
src/main/java/com/order/erp/service/order/OrderProfitAnalysisService.java deleted
100644 → 0
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.OrderProfitAnalysisDO; | |
6 | -import com.order.erp.domain.vo.OrderProfitAnalysisVo; | |
7 | -import com.order.erp.domain.vo.order.OrderProfitAnalysisQueryVO; | |
8 | -import com.order.erp.domain.vo.order.OrderProfitAnalysisVO; | |
9 | -import com.order.erp.domain.vo.order.ProfitCalculateVO; | |
10 | - | |
11 | -import java.util.List; | |
12 | - | |
13 | -/** | |
14 | - * 订单利润分析表(OrderProfitAnalysis)表服务接口 | |
15 | - * | |
16 | - * @author makejava | |
17 | - * @since 2023-09-08 15:26:47 | |
18 | - */ | |
19 | -public interface OrderProfitAnalysisService extends IService<OrderProfitAnalysisDO> { | |
20 | - | |
21 | - /** | |
22 | - * 通过ID查询单条数据 | |
23 | - * | |
24 | - * @param orderProfitAnalysisQueryVO 主键 | |
25 | - * @return 实例对象 | |
26 | - */ | |
27 | - ServerResult queryById(OrderProfitAnalysisQueryVO orderProfitAnalysisQueryVO); | |
28 | - | |
29 | - /** | |
30 | - * 分页查询 | |
31 | - * | |
32 | - * @param orderProfitAnalysisQueryVO 筛选条件 | |
33 | - * @return 查询结果 | |
34 | - */ | |
35 | - ServerResult list(OrderProfitAnalysisQueryVO orderProfitAnalysisQueryVO); | |
36 | - | |
37 | - /** | |
38 | - * 新增数据 | |
39 | - * | |
40 | - * @param orderProfitAnalysisVO 数据VO | |
41 | - * @return 新增结果 | |
42 | - */ | |
43 | - ServerResult add(OrderProfitAnalysisVO orderProfitAnalysisVO); | |
44 | - | |
45 | - /** | |
46 | - * 修改数据 | |
47 | - * | |
48 | - * @param orderProfitAnalysisVO 数据VO | |
49 | - * @return 编辑结果 | |
50 | - */ | |
51 | - ServerResult edit(OrderProfitAnalysisVO orderProfitAnalysisVO); | |
52 | - | |
53 | - /** | |
54 | - * 通过主键删除数据 | |
55 | - * | |
56 | - * @param orderProfitAnalysisQueryVO 筛选条件 | |
57 | - * @return 是否成功 | |
58 | - */ | |
59 | - ServerResult deleteById(OrderProfitAnalysisQueryVO orderProfitAnalysisQueryVO); | |
60 | - | |
61 | - boolean deleteByOrderId(Long orderId); | |
62 | - | |
63 | - boolean deleteByOrderIds(List<Long> orderIds); | |
64 | - | |
65 | - ServerResult<OrderProfitAnalysisVO> analysisByOrderIds(OrderProfitAnalysisVo orderProfitAnalysisVo); | |
66 | - | |
67 | - ServerResult<OrderProfitAnalysisVO> analysis(OrderProfitAnalysisVo orderProfitAnalysisVo); | |
68 | - | |
69 | - ServerResult<OrderProfitAnalysisVO> analysisByQueryVO(OrderProfitAnalysisVo orderProfitAnalysisVo); | |
70 | - | |
71 | - ServerResult calculate(ProfitCalculateVO calculateVO); | |
72 | - | |
73 | - long countByOrderStatus(Integer status); | |
74 | - | |
75 | - long countRecentWeekByOrderStatus(Integer status); | |
76 | -} |
src/main/java/com/order/erp/service/order/OrderTrackStageService.java deleted
100644 → 0
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.OrderTrackStageDO; | |
6 | -import com.order.erp.domain.vo.order.OrderTrackStageQueryVO; | |
7 | -import com.order.erp.domain.vo.order.OrderTrackStageVO; | |
8 | - | |
9 | -import java.util.List; | |
10 | - | |
11 | -/** | |
12 | - * 订单-跟单环节(OrderTrackStage)表服务接口 | |
13 | - * | |
14 | - * @author makejava | |
15 | - * @since 2023-09-08 15:26:48 | |
16 | - */ | |
17 | -public interface OrderTrackStageService extends IService<OrderTrackStageDO> { | |
18 | - | |
19 | - /** | |
20 | - * 通过ID查询单条数据 | |
21 | - * | |
22 | - * @param orderTrackStageQueryVO 主键 | |
23 | - * @return 实例对象 | |
24 | - */ | |
25 | - ServerResult queryById(OrderTrackStageQueryVO orderTrackStageQueryVO); | |
26 | - | |
27 | - /** | |
28 | - * 分页查询 | |
29 | - * | |
30 | - * @param orderTrackStageQueryVO 筛选条件 | |
31 | - * @return 查询结果 | |
32 | - */ | |
33 | - ServerResult list(OrderTrackStageQueryVO orderTrackStageQueryVO); | |
34 | - | |
35 | - /** | |
36 | - * 新增数据 | |
37 | - * | |
38 | - * @param orderTrackStageVO 数据VO | |
39 | - * @return 新增结果 | |
40 | - */ | |
41 | - ServerResult add(OrderTrackStageVO orderTrackStageVO); | |
42 | - | |
43 | - /** | |
44 | - * 修改数据 | |
45 | - * | |
46 | - * @param orderTrackStageVO 数据VO | |
47 | - * @return 编辑结果 | |
48 | - */ | |
49 | - ServerResult edit(OrderTrackStageVO orderTrackStageVO); | |
50 | - | |
51 | - /** | |
52 | - * 通过主键删除数据 | |
53 | - * | |
54 | - * @param orderTrackStageQueryVO 筛选条件 | |
55 | - * @return 是否成功 | |
56 | - */ | |
57 | - ServerResult deleteById(OrderTrackStageQueryVO orderTrackStageQueryVO); | |
58 | - | |
59 | - boolean deleteByOrderId(Long orderId); | |
60 | - | |
61 | - boolean deleteByOrderIds(List<Long> orderIds); | |
62 | -} |
src/main/java/com/order/erp/service/order/OrderUpdateLogService.java deleted
100644 → 0
1 | -package com.order.erp.service.order; | |
2 | - | |
3 | -import com.baomidou.mybatisplus.extension.service.IService; | |
4 | -import com.order.erp.common.constant.ServerResult; | |
5 | -import com.order.erp.domain.dto.order.OrderUpdateLogDO; | |
6 | -import com.order.erp.domain.vo.order.OrderUpdateLogQueryVO; | |
7 | -import com.order.erp.domain.vo.order.OrderUpdateLogVO; | |
8 | - | |
9 | -/** | |
10 | - * 订单更新日志表(OrderUpdateLog)表服务接口 | |
11 | - * | |
12 | - * @author makejava | |
13 | - * @since 2024-07-03 17:30:32 | |
14 | - */ | |
15 | -public interface OrderUpdateLogService extends IService<OrderUpdateLogDO> { | |
16 | - | |
17 | - /** | |
18 | - * 通过ID查询单条数据 | |
19 | - * | |
20 | - * @param orderUpdateLogQueryVO 主键 | |
21 | - * @return 实例对象 | |
22 | - */ | |
23 | - ServerResult queryById(OrderUpdateLogQueryVO orderUpdateLogQueryVO); | |
24 | - | |
25 | - /** | |
26 | - * 分页查询 | |
27 | - * | |
28 | - * @param orderUpdateLogQueryVO 筛选条件 | |
29 | - * @return 查询结果 | |
30 | - */ | |
31 | - ServerResult list(OrderUpdateLogQueryVO orderUpdateLogQueryVO); | |
32 | - | |
33 | - /** | |
34 | - * 新增数据 | |
35 | - * | |
36 | - * @param orderUpdateLogVO 数据VO | |
37 | - * @return 新增结果 | |
38 | - */ | |
39 | - ServerResult add(OrderUpdateLogVO orderUpdateLogVO); | |
40 | - | |
41 | - /** | |
42 | - * 修改数据 | |
43 | - * | |
44 | - * @param orderUpdateLogVO 数据VO | |
45 | - * @return 编辑结果 | |
46 | - */ | |
47 | - ServerResult edit(OrderUpdateLogVO orderUpdateLogVO); | |
48 | - | |
49 | - /** | |
50 | - * 通过主键删除数据 | |
51 | - * | |
52 | - * @param orderUpdateLogQueryVO 筛选条件 | |
53 | - * @return 是否成功 | |
54 | - */ | |
55 | - ServerResult deleteById(OrderUpdateLogQueryVO orderUpdateLogQueryVO); | |
56 | - | |
57 | -} |
src/main/java/com/order/erp/service/order/ProducePaymentCheckBillOrderService.java deleted
100644 → 0
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/ReceiveEmailMappingService.java deleted
100644 → 0
1 | -package com.order.erp.service.order; | |
2 | - | |
3 | -import com.baomidou.mybatisplus.extension.service.IService; | |
4 | -import com.order.erp.common.constant.ServerResult; | |
5 | -import com.order.erp.domain.dto.order.ReceiveEmailMappingDO; | |
6 | -import com.order.erp.domain.vo.order.ReceiveEmailMappingQueryVO; | |
7 | -import com.order.erp.domain.vo.order.ReceiveEmailMappingVO; | |
8 | - | |
9 | - | |
10 | -/** | |
11 | - * 邮件接收人信息绑定表(ReceiveEmailMapping)表服务接口 | |
12 | - * | |
13 | - * @author makejava | |
14 | - * @since 2024-07-03 10:58:52 | |
15 | - */ | |
16 | -public interface ReceiveEmailMappingService extends IService<ReceiveEmailMappingDO> { | |
17 | - | |
18 | - /** | |
19 | - * 通过ID查询单条数据 | |
20 | - * | |
21 | - * @param receiveEmailMappingQueryVO 主键 | |
22 | - * @return 实例对象 | |
23 | - */ | |
24 | - ServerResult queryById(ReceiveEmailMappingQueryVO receiveEmailMappingQueryVO); | |
25 | - | |
26 | - /** | |
27 | - * 分页查询 | |
28 | - * | |
29 | - * | |
30 | - * @return 查询结果 | |
31 | - */ | |
32 | - ServerResult listGetAll(); | |
33 | - | |
34 | - /** | |
35 | - * 新增数据 | |
36 | - * | |
37 | - * @param receiveEmailMappingVO 数据VO | |
38 | - * @return 新增结果 | |
39 | - */ | |
40 | - ServerResult add(ReceiveEmailMappingVO receiveEmailMappingVO); | |
41 | - | |
42 | - /** | |
43 | - * 修改数据 | |
44 | - * | |
45 | - * @param receiveEmailMappingVO 数据VO | |
46 | - * @return 编辑结果 | |
47 | - */ | |
48 | - ServerResult edit(ReceiveEmailMappingVO receiveEmailMappingVO); | |
49 | - | |
50 | - /** | |
51 | - * 通过主键删除数据 | |
52 | - * | |
53 | - * @param receiveEmailMappingVO 筛选条件 | |
54 | - * @return 是否成功 | |
55 | - */ | |
56 | - ServerResult deleteById(ReceiveEmailMappingVO receiveEmailMappingVO); | |
57 | - | |
58 | - ServerResult opt(ReceiveEmailMappingDO receiveEmailMappingDo); | |
59 | - | |
60 | -} |
src/main/java/com/order/erp/service/order/impl/CheckBillMappingServiceImpl.java deleted
100644 → 0
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/EmailTemplateServiceImpl.java deleted
100644 → 0
1 | -package com.order.erp.service.order.impl; | |
2 | - | |
3 | -import cn.hutool.core.bean.BeanUtil; | |
4 | -import cn.hutool.core.collection.CollUtil; | |
5 | -import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; | |
6 | -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | |
7 | -import com.order.erp.common.constant.Constant; | |
8 | -import com.order.erp.common.constant.ServerResult; | |
9 | -import com.order.erp.common.utils.PageUtils; | |
10 | -import com.order.erp.domain.dto.order.EmailTemplateDO; | |
11 | -import com.order.erp.domain.vo.order.EmailTemplateQueryVO; | |
12 | -import com.order.erp.domain.vo.order.EmailTemplateVO; | |
13 | -import com.order.erp.mapper.order.EmailTemplateMapper; | |
14 | -import com.order.erp.service.order.EmailTemplateService; | |
15 | -import lombok.extern.slf4j.Slf4j; | |
16 | -import org.springframework.stereotype.Service; | |
17 | - | |
18 | -import java.util.List; | |
19 | -import java.util.Objects; | |
20 | - | |
21 | -/** | |
22 | - * 邮件模板表(EmailTemplate)表服务实现类 | |
23 | - * | |
24 | - * @author makejava | |
25 | - * @since 2024-07-03 10:58:28 | |
26 | - */ | |
27 | -@Slf4j | |
28 | -@Service | |
29 | -public class EmailTemplateServiceImpl extends ServiceImpl<EmailTemplateMapper, EmailTemplateDO> implements EmailTemplateService { | |
30 | - | |
31 | - | |
32 | - /** | |
33 | - * 通过ID查询单条数据 | |
34 | - * <p> | |
35 | - * emailTemplateQueryVO 主键 | |
36 | - * | |
37 | - * @return 实例对象 | |
38 | - */ | |
39 | - @Override | |
40 | - public ServerResult queryById(EmailTemplateQueryVO emailTemplateQueryVO) { | |
41 | - if (Objects.isNull(emailTemplateQueryVO.getId())) { | |
42 | - return ServerResult.fail("id 不能为空"); | |
43 | - } | |
44 | - EmailTemplateDO EmailTemplateDo = getById(emailTemplateQueryVO.getId()); | |
45 | - if (Objects.isNull(EmailTemplateDo)) { | |
46 | - return ServerResult.success(null); | |
47 | - } | |
48 | - return ServerResult.success(BeanUtil.copyProperties(EmailTemplateDo, EmailTemplateVO.class)); | |
49 | - } | |
50 | - | |
51 | - /** | |
52 | - * 分页查询 | |
53 | - * | |
54 | - * @param emailTemplateQueryVO 筛选条件 | |
55 | - * @return 查询结果 | |
56 | - */ | |
57 | - @Override | |
58 | - public ServerResult list(EmailTemplateQueryVO emailTemplateQueryVO) { | |
59 | - | |
60 | - //todo | |
61 | - return ServerResult.success(PageUtils.getPageReturn(null, emailTemplateQueryVO)); | |
62 | - } | |
63 | - | |
64 | - /** | |
65 | - * 新增数据 | |
66 | - * | |
67 | - * @param emailTemplateVO 实例对象 | |
68 | - * @return 实例对象 | |
69 | - */ | |
70 | - @Override | |
71 | - public ServerResult add(EmailTemplateVO emailTemplateVO) { | |
72 | - //todo 校验 | |
73 | - if (Objects.nonNull(emailTemplateVO.getId())) { | |
74 | - emailTemplateVO.setId(null); | |
75 | - } | |
76 | - EmailTemplateDO emailTemplateDo = BeanUtil.copyProperties(emailTemplateVO, EmailTemplateDO.class); | |
77 | - | |
78 | - save(emailTemplateDo); | |
79 | - | |
80 | - return ServerResult.success(); | |
81 | - } | |
82 | - | |
83 | - /** | |
84 | - * 修改数据 | |
85 | - * | |
86 | - * @param emailTemplateVO 实例对象 | |
87 | - * @return 实例对象 | |
88 | - */ | |
89 | - @Override | |
90 | - public ServerResult edit(EmailTemplateVO emailTemplateVO) { | |
91 | - //todo 校验 | |
92 | - if (Objects.isNull(emailTemplateVO.getId())) { | |
93 | - return ServerResult.fail("id 不能为空"); | |
94 | - } | |
95 | - EmailTemplateDO emailTemplateDo = BeanUtil.copyProperties(emailTemplateVO, EmailTemplateDO.class); | |
96 | - | |
97 | - updateById(emailTemplateDo); | |
98 | - | |
99 | - return ServerResult.success(); | |
100 | - } | |
101 | - | |
102 | - /** | |
103 | - * 通过主键删除数据 | |
104 | - * | |
105 | - * @param emailTemplateQueryVO 筛选条件 | |
106 | - * @return 是否成功 | |
107 | - */ | |
108 | - @Override | |
109 | - public ServerResult deleteById(EmailTemplateQueryVO emailTemplateQueryVO) { | |
110 | - List<Long> ids = emailTemplateQueryVO.getIds(); | |
111 | - if (CollUtil.isEmpty(ids)) { | |
112 | - return ServerResult.fail("ids 参数不能为空"); | |
113 | - } | |
114 | - List<EmailTemplateDO> emailTemplateList = listByIds(ids); | |
115 | - if (CollUtil.isEmpty(emailTemplateList)) { | |
116 | - return ServerResult.success(); | |
117 | - } | |
118 | - //todo 校验是否可以逻辑删除 | |
119 | - LambdaUpdateWrapper<EmailTemplateDO> updateWrapper = new LambdaUpdateWrapper<EmailTemplateDO>() | |
120 | - .in(EmailTemplateDO::getId, ids) | |
121 | - .set(EmailTemplateDO::getEnableFlag, Constant.UNABLE_TWENTY); | |
122 | - update(updateWrapper); | |
123 | - return ServerResult.success(); | |
124 | - } | |
125 | -} |
src/main/java/com/order/erp/service/order/impl/InvoiceBillMappingServiceImpl.java deleted
100644 → 0
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 deleted
100644 → 0
1 | -package com.order.erp.service.order.impl; | |
2 | - | |
3 | -import cn.hutool.core.collection.CollUtil; | |
4 | -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | |
5 | -import com.baomidou.mybatisplus.core.metadata.IPage; | |
6 | -import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; | |
7 | -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | |
8 | -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | |
9 | -import com.order.erp.common.constant.Constant; | |
10 | -import com.order.erp.common.constant.ServerResult; | |
11 | -import com.order.erp.common.exception.BusinessException; | |
12 | -import com.order.erp.common.utils.StringUtils; | |
13 | -import com.order.erp.common.utils.TransactionHelper; | |
14 | -import com.order.erp.domain.dto.BaseDO; | |
15 | -import com.order.erp.domain.dto.order.InvoiceBillMappingDO; | |
16 | -import com.order.erp.domain.dto.order.InvoiceBillOrderDO; | |
17 | -import com.order.erp.domain.dto.order.OrderBaseInfoDO; | |
18 | -import com.order.erp.domain.vo.order.*; | |
19 | -import com.order.erp.mapper.order.InvoiceBillOrderMapper; | |
20 | -import com.order.erp.service.order.InvoiceBillMappingService; | |
21 | -import com.order.erp.service.order.InvoiceBillOrderService; | |
22 | -import com.order.erp.service.order.OrderBaseInfoService; | |
23 | -import lombok.extern.slf4j.Slf4j; | |
24 | -import org.springframework.stereotype.Service; | |
25 | - | |
26 | -import javax.annotation.Resource; | |
27 | -import java.util.*; | |
28 | -import java.util.stream.Collectors; | |
29 | - | |
30 | -/** | |
31 | - * 应收款账单表(InvoiceBillOrder)表服务实现类 | |
32 | - * | |
33 | - * @author makejava | |
34 | - * @since 2024-08-05 16:26:34 | |
35 | - */ | |
36 | -@Slf4j | |
37 | -@Service | |
38 | -public class InvoiceBillOrderServiceImpl extends ServiceImpl<InvoiceBillOrderMapper, InvoiceBillOrderDO> implements InvoiceBillOrderService { | |
39 | - | |
40 | - | |
41 | - @Resource | |
42 | - private OrderBaseInfoService orderBaseInfoService; | |
43 | - | |
44 | - @Resource | |
45 | - private InvoiceBillMappingService invoiceBillMappingService; | |
46 | - | |
47 | - @Resource | |
48 | - private TransactionHelper transactionHelper; | |
49 | - | |
50 | - | |
51 | - /** | |
52 | - * 分页查询 | |
53 | - * | |
54 | - * @param queryVO 筛选条件 | |
55 | - * @return 查询结果 | |
56 | - */ | |
57 | - @Override | |
58 | - public ServerResult listByPage(InvoiceBillOrderQueryVO queryVO) { | |
59 | - Set<Long> billOrderIds = filterBillOrderIdsBy(queryVO); | |
60 | - | |
61 | - LambdaQueryWrapper<InvoiceBillOrderDO> queryWrapper = new LambdaQueryWrapper<InvoiceBillOrderDO>() | |
62 | - .eq(InvoiceBillOrderDO::getEnableFlag, Constant.ENABLE_TEN) | |
63 | - .in(CollectionUtils.isNotEmpty(billOrderIds), InvoiceBillOrderDO::getId, billOrderIds) | |
64 | - .eq(StringUtils.isNotBlank(queryVO.getInvoiceNo()), InvoiceBillOrderDO::getInvoiceNo, queryVO.getInvoiceNo()) | |
65 | - .eq(Objects.nonNull(queryVO.getStatus()), InvoiceBillOrderDO::getStatus, queryVO.getStatus()) | |
66 | - .orderByDesc(InvoiceBillOrderDO::getId); | |
67 | - Page page = new Page<>(queryVO.getPage(), queryVO.getPageSize()); | |
68 | - IPage<InvoiceBillOrderDO> iPage = page(page, queryWrapper); | |
69 | - return ServerResult.success(iPage); | |
70 | - } | |
71 | - | |
72 | - @Override | |
73 | - public ServerResult listBaseOrderInfoBy(InvoiceBaseOrderQueryVO queryVO) { | |
74 | - List<InvoiceBillMappingDO> mappingDOS = invoiceBillMappingService.list(new LambdaQueryWrapper<InvoiceBillMappingDO>() | |
75 | - .eq(BaseDO::getEnableFlag, Constant.ENABLE_TEN) | |
76 | - .eq(InvoiceBillMappingDO::getInvoiceNo, queryVO.getInvoiceNo())); | |
77 | - if (CollectionUtils.isEmpty(mappingDOS)) { | |
78 | - return ServerResult.success(); | |
79 | - } | |
80 | - Set<Long> orderIds = mappingDOS.stream().map(InvoiceBillMappingDO::getOrderId).collect(Collectors.toSet()); | |
81 | - return ServerResult.success(orderBaseInfoService.listByIds(orderIds)); | |
82 | - } | |
83 | - | |
84 | - /** | |
85 | - * @param queryVO | |
86 | - * @return | |
87 | - */ | |
88 | - private Set<Long> filterBillOrderIdsBy(InvoiceBillOrderQueryVO queryVO) { | |
89 | - List<Long> orderIds = filterOrderIdsBy(queryVO); | |
90 | - if (CollectionUtils.isEmpty(orderIds)) { | |
91 | - return null; | |
92 | - } | |
93 | - List<InvoiceBillMappingDO> mappingDOS = invoiceBillMappingService.list(new LambdaQueryWrapper<InvoiceBillMappingDO>().eq(BaseDO::getEnableFlag, Constant.ENABLE_TEN) | |
94 | - .in(CollectionUtils.isNotEmpty(orderIds), InvoiceBillMappingDO::getOrderId, orderIds)); | |
95 | - if (CollectionUtils.isEmpty(mappingDOS)) { | |
96 | - Set<Long> ids = new HashSet<>(); | |
97 | - ids.add(-1L); | |
98 | - return ids; | |
99 | - } | |
100 | - return mappingDOS.stream().map(InvoiceBillMappingDO::getInvoiceBillId).collect(Collectors.toSet()); | |
101 | - } | |
102 | - | |
103 | - /** | |
104 | - * @param queryVO | |
105 | - * @return | |
106 | - */ | |
107 | - private List<Long> filterOrderIdsBy(InvoiceBillOrderQueryVO queryVO) { | |
108 | - Boolean flag = false; | |
109 | - if (StringUtils.isNotBlank(queryVO.getCustomerCode())) { | |
110 | - flag = flag | true; | |
111 | - } | |
112 | - if (StringUtils.isNotBlank(queryVO.getProductionDepartment())) { | |
113 | - flag = flag | true; | |
114 | - } | |
115 | - if (StringUtils.isNotBlank(queryVO.getCustomerPo())) { | |
116 | - flag = flag | true; | |
117 | - } | |
118 | - if (StringUtils.isNotBlank(queryVO.getInnerNo())) { | |
119 | - flag = flag | true; | |
120 | - } | |
121 | - if (StringUtils.isNotBlank(queryVO.getProjectNo())) { | |
122 | - flag = flag | true; | |
123 | - } | |
124 | - if (!flag) { | |
125 | - return null; | |
126 | - } | |
127 | - LambdaQueryWrapper<OrderBaseInfoDO> queryWrapper = new LambdaQueryWrapper<OrderBaseInfoDO>() | |
128 | - .eq(OrderBaseInfoDO::getEnableFlag, Constant.ENABLE_TEN) | |
129 | - .eq(StringUtils.isNotBlank(queryVO.getCustomerCode()), OrderBaseInfoDO::getCustomerCode, queryVO.getCustomerCode()) | |
130 | - .eq(StringUtils.isNotBlank(queryVO.getProductionDepartment()), OrderBaseInfoDO::getProductionDepartment, queryVO.getProductionDepartment()) | |
131 | - .eq(StringUtils.isNotBlank(queryVO.getCustomerPo()), OrderBaseInfoDO::getCustomerPo, queryVO.getCustomerPo()) | |
132 | - .eq(StringUtils.isNotBlank(queryVO.getInnerNo()), OrderBaseInfoDO::getInnerNo, queryVO.getInnerNo()) | |
133 | - .eq(StringUtils.isNotBlank(queryVO.getProjectNo()), OrderBaseInfoDO::getProjectNo, queryVO.getProjectNo()); | |
134 | - List<OrderBaseInfoDO> orderBaseInfoDOList = orderBaseInfoService.list(queryWrapper); | |
135 | - if (CollectionUtils.isEmpty(orderBaseInfoDOList)) { | |
136 | - List<Long> orderIds = new ArrayList<>(); | |
137 | - orderIds.add(-1L); | |
138 | - return orderIds; | |
139 | - } | |
140 | - return orderBaseInfoDOList.stream().map(OrderBaseInfoDO::getId).collect(Collectors.toList()); | |
141 | - } | |
142 | - | |
143 | - /** | |
144 | - * 创建invoice单据 | |
145 | - * | |
146 | - * @param createVO 实例对象 | |
147 | - * @return 实例对象 | |
148 | - */ | |
149 | - @Override | |
150 | - public ServerResult create(InvoiceBillCreateVO createVO) { | |
151 | - if (Objects.nonNull(createVO.getId())) { | |
152 | - createVO.setId(null); | |
153 | - } | |
154 | - | |
155 | - validaBillOrder(createVO); | |
156 | - | |
157 | - InvoiceBillOrderDO invoiceBillOrderDO = buildInvoiceBillOrderDO(createVO); | |
158 | - | |
159 | - transactionHelper.run(() -> { | |
160 | - save(invoiceBillOrderDO); | |
161 | - | |
162 | - invoiceBillMappingService.saveBatch(buildInvoiceBillMappingDOS(createVO, invoiceBillOrderDO)); | |
163 | - }); | |
164 | - | |
165 | - return ServerResult.success(); | |
166 | - } | |
167 | - | |
168 | - /** | |
169 | - * @param createVO | |
170 | - * @return | |
171 | - */ | |
172 | - private InvoiceBillOrderDO buildInvoiceBillOrderDO(InvoiceBillCreateVO createVO) { | |
173 | - return InvoiceBillOrderDO.builder() | |
174 | - .invoiceNo(createVO.getInvoiceNo()) | |
175 | - .bgUrl(createVO.getBgUrl()) | |
176 | - .backRefundDate(createVO.getBackRefundDate()) | |
177 | - .build(); | |
178 | - } | |
179 | - | |
180 | - /** | |
181 | - * @param createVO | |
182 | - * @param invoiceBillOrderDO | |
183 | - * @return | |
184 | - */ | |
185 | - private List<InvoiceBillMappingDO> buildInvoiceBillMappingDOS(InvoiceBillCreateVO createVO, InvoiceBillOrderDO invoiceBillOrderDO) { | |
186 | - return createVO.getOrderIds().stream().map(x -> { | |
187 | - return InvoiceBillMappingDO.builder() | |
188 | - .orderId(x) | |
189 | - .invoiceBillId(invoiceBillOrderDO.getId()) | |
190 | - .invoiceNo(invoiceBillOrderDO.getInvoiceNo()) | |
191 | - .build(); | |
192 | - }).collect(Collectors.toList()); | |
193 | - } | |
194 | - | |
195 | - /** | |
196 | - * @param createVO | |
197 | - */ | |
198 | - private void validaBillOrder(InvoiceBillCreateVO createVO) { | |
199 | - if (CollectionUtils.isEmpty(createVO.getOrderIds())) { | |
200 | - throw new BusinessException("请勾选订单!"); | |
201 | - } | |
202 | - | |
203 | - List<OrderBaseInfoDO> orderBaseInfoDOList = orderBaseInfoService.listByIds(createVO.getOrderIds()); | |
204 | - if (CollectionUtils.isEmpty(orderBaseInfoDOList)) { | |
205 | - throw new BusinessException("勾选的订单信息不存在!"); | |
206 | - } | |
207 | - | |
208 | - if (orderBaseInfoDOList.size() != createVO.getOrderIds().size()) { | |
209 | - throw new BusinessException("勾选的订单信息有误!"); | |
210 | - } | |
211 | - | |
212 | - String invoiceNo = createVO.getInvoiceNo(); | |
213 | - | |
214 | - List<InvoiceBillOrderDO> invoiceBillOrderDOS = list(new LambdaQueryWrapper<InvoiceBillOrderDO>() | |
215 | - .eq(BaseDO::getEnableFlag, Constant.ENABLE_TEN) | |
216 | - .eq(InvoiceBillOrderDO::getInvoiceNo, invoiceNo)); | |
217 | - if (CollectionUtils.isNotEmpty(invoiceBillOrderDOS)) { | |
218 | - throw new BusinessException("存在相同的invoice订单!"); | |
219 | - } | |
220 | - | |
221 | - } | |
222 | - | |
223 | - /** | |
224 | - * 修改数据 | |
225 | - * | |
226 | - * @param deductInfoVO 实例对象 | |
227 | - * @return 实例对象 | |
228 | - */ | |
229 | - @Override | |
230 | - public ServerResult updateDeductInfo(InvoiceBillDeductInfoVO deductInfoVO) { | |
231 | - if (Objects.isNull(deductInfoVO.getId())) { | |
232 | - throw new BusinessException("id 不能为空"); | |
233 | - } | |
234 | - InvoiceBillOrderDO invoiceBillOrderDo = getById(deductInfoVO.getId()); | |
235 | - if (Objects.isNull(invoiceBillOrderDo)) { | |
236 | - throw new BusinessException("应收款单据不存在"); | |
237 | - } | |
238 | - invoiceBillOrderDo.setDeductUrl(deductInfoVO.getDeductUrl()); | |
239 | - invoiceBillOrderDo.setDeductAmount(deductInfoVO.getDeductAmount()); | |
240 | - updateById(invoiceBillOrderDo); | |
241 | - return ServerResult.success(); | |
242 | - } | |
243 | - | |
244 | - @Override | |
245 | - public ServerResult updateAmountInfo(InvoiceBillAmountInfoVO amountInfoVO) { | |
246 | - if (Objects.isNull(amountInfoVO.getId())) { | |
247 | - throw new BusinessException("id 不能为空"); | |
248 | - } | |
249 | - InvoiceBillOrderDO invoiceBillOrderDo = getById(amountInfoVO.getId()); | |
250 | - if (Objects.isNull(invoiceBillOrderDo)) { | |
251 | - throw new BusinessException("应收款单据不存在"); | |
252 | - } | |
253 | - invoiceBillOrderDo.setBgUrl(amountInfoVO.getBgUrl()); | |
254 | - invoiceBillOrderDo.setActualReceivableAmount(amountInfoVO.getActualReceivableAmount()); | |
255 | - invoiceBillOrderDo.setActualPayedAmount1(amountInfoVO.getActualPayedAmount1()); | |
256 | - invoiceBillOrderDo.setActualPayedAmount2(amountInfoVO.getActualPayedAmount2()); | |
257 | - invoiceBillOrderDo.setActualPayedAmount3(amountInfoVO.getActualPayedAmount3()); | |
258 | - invoiceBillOrderDo.setOtherAmount(amountInfoVO.getOtherAmount()); | |
259 | - updateById(invoiceBillOrderDo); | |
260 | - return ServerResult.success(); | |
261 | - } | |
262 | - | |
263 | - /** | |
264 | - * 通过主键删除数据 | |
265 | - * | |
266 | - * @param invoiceBillOrderQueryVO 筛选条件 | |
267 | - * @return 是否成功 | |
268 | - */ | |
269 | - @Override | |
270 | - public ServerResult deleteById(InvoiceBillOrderQueryVO invoiceBillOrderQueryVO) { | |
271 | - List<Long> ids = invoiceBillOrderQueryVO.getIds(); | |
272 | - if (CollUtil.isEmpty(ids)) { | |
273 | - return ServerResult.fail("ids 参数不能为空"); | |
274 | - } | |
275 | - List<InvoiceBillOrderDO> invoiceBillOrderList = listByIds(ids); | |
276 | - if (CollUtil.isEmpty(invoiceBillOrderList)) { | |
277 | - return ServerResult.success(); | |
278 | - } | |
279 | - transactionHelper.run(() -> { | |
280 | - removeByIds(ids); | |
281 | - invoiceBillMappingService.remove(new LambdaQueryWrapper<InvoiceBillMappingDO>().in(InvoiceBillMappingDO::getInvoiceBillId, ids)); | |
282 | - }); | |
283 | - | |
284 | - return ServerResult.success(); | |
285 | - } | |
286 | -} |
src/main/java/com/order/erp/service/order/impl/OrderAuditLogServiceImpl.java deleted
100644 → 0
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.core.toolkit.CollectionUtils; | |
9 | -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | |
10 | -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | |
11 | -import com.order.erp.common.constant.Constant; | |
12 | -import com.order.erp.common.constant.ServerResult; | |
13 | -import com.order.erp.domain.dto.BaseDO; | |
14 | -import com.order.erp.domain.dto.admin.AdminUserDO; | |
15 | -import com.order.erp.domain.dto.order.OrderAuditLogDO; | |
16 | -import com.order.erp.domain.dto.order.OrderFieldLockApplyDO; | |
17 | -import com.order.erp.domain.vo.order.OrderAuditLogQueryVO; | |
18 | -import com.order.erp.domain.vo.order.OrderAuditLogResultVO; | |
19 | -import com.order.erp.domain.vo.order.OrderAuditLogVO; | |
20 | -import com.order.erp.mapper.order.OrderAuditLogMapper; | |
21 | -import com.order.erp.service.admin.AdminUserService; | |
22 | -import com.order.erp.service.order.OrderAuditLogService; | |
23 | -import com.order.erp.service.order.OrderFieldLockApplyService; | |
24 | -import lombok.extern.slf4j.Slf4j; | |
25 | -import org.springframework.beans.BeanUtils; | |
26 | -import org.springframework.stereotype.Service; | |
27 | - | |
28 | -import javax.annotation.Resource; | |
29 | -import java.util.*; | |
30 | -import java.util.function.Function; | |
31 | -import java.util.stream.Collectors; | |
32 | - | |
33 | -/** | |
34 | - * 用户订单审批日志表(OrderAuditLog)表服务实现类 | |
35 | - * | |
36 | - * @author makejava | |
37 | - * @since 2023-09-08 15:26:42 | |
38 | - */ | |
39 | -@Slf4j | |
40 | -@Service | |
41 | -public class OrderAuditLogServiceImpl extends ServiceImpl<OrderAuditLogMapper, OrderAuditLogDO> implements OrderAuditLogService { | |
42 | - | |
43 | - | |
44 | - @Resource | |
45 | - private AdminUserService userService; | |
46 | - | |
47 | - @Resource | |
48 | - private OrderFieldLockApplyService applyService; | |
49 | - | |
50 | - /** | |
51 | - * 通过ID查询单条数据 | |
52 | - * <p> | |
53 | - * orderAuditLogQueryVO 主键 | |
54 | - * | |
55 | - * @return 实例对象 | |
56 | - */ | |
57 | - @Override | |
58 | - public ServerResult queryById(OrderAuditLogQueryVO orderAuditLogQueryVO) { | |
59 | - if (Objects.isNull(orderAuditLogQueryVO.getId())) { | |
60 | - return ServerResult.fail("id 不能为空"); | |
61 | - } | |
62 | - OrderAuditLogDO OrderAuditLogDo = getById(orderAuditLogQueryVO.getId()); | |
63 | - if (Objects.isNull(OrderAuditLogDo)) { | |
64 | - return ServerResult.success(null); | |
65 | - } | |
66 | - return ServerResult.success(BeanUtil.copyProperties(OrderAuditLogDo, OrderAuditLogVO.class)); | |
67 | - } | |
68 | - | |
69 | - /** | |
70 | - * 分页查询 | |
71 | - * | |
72 | - * @param orderAuditLogQueryVO 筛选条件 | |
73 | - * @return 查询结果 | |
74 | - */ | |
75 | - @Override | |
76 | - public ServerResult list(OrderAuditLogQueryVO orderAuditLogQueryVO) { | |
77 | - | |
78 | - return ServerResult.success(); | |
79 | - } | |
80 | - | |
81 | - @Override | |
82 | - public ServerResult listByPage(OrderAuditLogQueryVO queryVO) { | |
83 | - LambdaQueryWrapper<OrderAuditLogDO> queryWrapper = buildQueryByParam(queryVO); | |
84 | - Page page = new Page<>(queryVO.getPage(), queryVO.getPageSize()); | |
85 | - IPage<OrderAuditLogDO> iPage = page(page, queryWrapper); | |
86 | - | |
87 | - Page<OrderAuditLogResultVO> webVOPage = new Page<>(); | |
88 | - List<OrderAuditLogDO> auditLogDOS = iPage.getRecords(); | |
89 | - if (CollectionUtils.isNotEmpty(auditLogDOS)) { | |
90 | - Set<Long> applyIds = auditLogDOS.stream().map(OrderAuditLogDO::getApplyId).collect(Collectors.toSet()); | |
91 | - Map<Long, AdminUserDO> userDOMap = new HashMap<>(); | |
92 | - Map<Long, OrderFieldLockApplyDO> applyDOMap = new HashMap<>(); | |
93 | - Set<Long> userIds = new HashSet<>(); | |
94 | - if (CollectionUtils.isNotEmpty(applyIds)) { | |
95 | - List<OrderFieldLockApplyDO> applyDOS = applyService.listByIds(applyIds); | |
96 | - if (CollectionUtils.isNotEmpty(applyDOS)) { | |
97 | - userIds.addAll(applyDOS.stream().map(OrderFieldLockApplyDO::getApplyUserId).collect(Collectors.toSet())); | |
98 | - userIds.addAll(applyDOS.stream().map(OrderFieldLockApplyDO::getAuditUserId).collect(Collectors.toSet())); | |
99 | - applyDOMap = applyDOS.stream().collect(Collectors.toMap(OrderFieldLockApplyDO::getId, Function.identity())); | |
100 | - } | |
101 | - } | |
102 | - if (CollectionUtils.isNotEmpty(userIds)) { | |
103 | - List<AdminUserDO> userDOS = userService.listByIds(userIds); | |
104 | - if (CollectionUtils.isNotEmpty(userDOS)) { | |
105 | - userDOMap = userDOS.stream().collect(Collectors.toMap(AdminUserDO::getId, Function.identity())); | |
106 | - } | |
107 | - } | |
108 | - Map<Long, AdminUserDO> finalUserDOMap = userDOMap; | |
109 | - Map<Long, OrderFieldLockApplyDO> finalApplyDOMap = applyDOMap; | |
110 | - List<OrderAuditLogResultVO> resultVOList = auditLogDOS.stream().map(x -> { | |
111 | - OrderAuditLogResultVO resultVO = new OrderAuditLogResultVO(); | |
112 | - BeanUtils.copyProperties(x, resultVO); | |
113 | - if (finalApplyDOMap.containsKey(x.getApplyId())) { | |
114 | - OrderFieldLockApplyDO applyDO = finalApplyDOMap.get(x.getApplyId()); | |
115 | - if (finalUserDOMap.containsKey(applyDO.getApplyUserId())) { | |
116 | - resultVO.setApplyUserName(finalUserDOMap.get(applyDO.getApplyUserId()).getUserName()); | |
117 | - } | |
118 | - if (finalUserDOMap.containsKey(applyDO.getAuditUserId())) { | |
119 | - resultVO.setAuditUserName(finalUserDOMap.get(applyDO.getAuditUserId()).getUserName()); | |
120 | - } | |
121 | - resultVO.setApplyRemark(applyDO.getRemark()); | |
122 | - resultVO.setFields(applyDO.getFields()); | |
123 | - } | |
124 | - return resultVO; | |
125 | - }).collect(Collectors.toList()); | |
126 | - | |
127 | - webVOPage.setRecords(resultVOList); | |
128 | - } | |
129 | - BeanUtils.copyProperties(page, webVOPage, "records"); | |
130 | - return ServerResult.success(webVOPage); | |
131 | - } | |
132 | - | |
133 | - /** | |
134 | - * @param queryVO | |
135 | - * @return | |
136 | - */ | |
137 | - private LambdaQueryWrapper<OrderAuditLogDO> buildQueryByParam(OrderAuditLogQueryVO queryVO) { | |
138 | - return new LambdaQueryWrapper<OrderAuditLogDO>() | |
139 | - .eq(BaseDO::getEnableFlag, Constant.ENABLE_TEN) | |
140 | - .eq(Objects.nonNull(queryVO.getOrderId()), OrderAuditLogDO::getOrderId, queryVO.getOrderId()) | |
141 | - .orderByDesc(OrderAuditLogDO::getId) | |
142 | - ; | |
143 | - } | |
144 | - | |
145 | - /** | |
146 | - * 新增数据 | |
147 | - * | |
148 | - * @param orderAuditLogVO 实例对象 | |
149 | - * @return 实例对象 | |
150 | - */ | |
151 | - @Override | |
152 | - public ServerResult add(OrderAuditLogVO orderAuditLogVO) { | |
153 | - //todo 校验 | |
154 | - if (Objects.nonNull(orderAuditLogVO.getId())) { | |
155 | - orderAuditLogVO.setId(null); | |
156 | - } | |
157 | - OrderAuditLogDO orderAuditLogDo = BeanUtil.copyProperties(orderAuditLogVO, OrderAuditLogDO.class); | |
158 | - | |
159 | - save(orderAuditLogDo); | |
160 | - | |
161 | - return ServerResult.success(); | |
162 | - } | |
163 | - | |
164 | - /** | |
165 | - * 修改数据 | |
166 | - * | |
167 | - * @param orderAuditLogVO 实例对象 | |
168 | - * @return 实例对象 | |
169 | - */ | |
170 | - @Override | |
171 | - public ServerResult edit(OrderAuditLogVO orderAuditLogVO) { | |
172 | - //todo 校验 | |
173 | - if (Objects.isNull(orderAuditLogVO.getId())) { | |
174 | - return ServerResult.fail("id 不能为空"); | |
175 | - } | |
176 | - OrderAuditLogDO orderAuditLogDo = BeanUtil.copyProperties(orderAuditLogVO, OrderAuditLogDO.class); | |
177 | - | |
178 | - updateById(orderAuditLogDo); | |
179 | - | |
180 | - return ServerResult.success(); | |
181 | - } | |
182 | - | |
183 | - /** | |
184 | - * 通过主键删除数据 | |
185 | - * | |
186 | - * @param orderAuditLogQueryVO 筛选条件 | |
187 | - * @return 是否成功 | |
188 | - */ | |
189 | - @Override | |
190 | - public ServerResult deleteById(OrderAuditLogQueryVO orderAuditLogQueryVO) { | |
191 | - List<Long> ids = orderAuditLogQueryVO.getIds(); | |
192 | - if (CollUtil.isEmpty(ids)) { | |
193 | - return ServerResult.fail("ids 参数不能为空"); | |
194 | - } | |
195 | - List<OrderAuditLogDO> orderAuditLogList = listByIds(ids); | |
196 | - if (CollUtil.isEmpty(orderAuditLogList)) { | |
197 | - return ServerResult.success(); | |
198 | - } | |
199 | - //todo 校验是否可以逻辑删除 | |
200 | - LambdaUpdateWrapper<OrderAuditLogDO> updateWrapper = new LambdaUpdateWrapper<OrderAuditLogDO>() | |
201 | - .in(OrderAuditLogDO::getId, ids) | |
202 | - .set(OrderAuditLogDO::getEnableFlag, Constant.UNABLE_TWENTY); | |
203 | - update(updateWrapper); | |
204 | - return ServerResult.success(); | |
205 | - } | |
206 | - | |
207 | - /** | |
208 | - * 逻辑删除,通过订单id删除 用户订单审批日志表(OrderAuditLog)实体类 | |
209 | - * | |
210 | - * @param orderId | |
211 | - * @return | |
212 | - */ | |
213 | - @Override | |
214 | - public boolean deleteByOrderId(Long orderId) { | |
215 | - LambdaUpdateWrapper<OrderAuditLogDO> updateWrapper = new LambdaUpdateWrapper<OrderAuditLogDO>() | |
216 | - .eq(OrderAuditLogDO::getOrderId, orderId) | |
217 | - .set(OrderAuditLogDO::getEnableFlag, Constant.UNABLE_TWENTY); | |
218 | - return update(updateWrapper); | |
219 | - } | |
220 | - | |
221 | - @Override | |
222 | - public boolean deleteByOrderIds(List<Long> orderIds) { | |
223 | - LambdaUpdateWrapper<OrderAuditLogDO> updateWrapper = new LambdaUpdateWrapper<OrderAuditLogDO>() | |
224 | - .in(OrderAuditLogDO::getOrderId, orderIds) | |
225 | - .set(OrderAuditLogDO::getEnableFlag, Constant.UNABLE_TWENTY); | |
226 | - return update(updateWrapper); | |
227 | - } | |
228 | -} |
src/main/java/com/order/erp/service/order/impl/OrderBaseInfoServiceImpl.java deleted
100644 → 0
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 cn.hutool.core.collection.CollectionUtil; | |
6 | -import com.alibaba.fastjson.JSONObject; | |
7 | -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | |
8 | -import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; | |
9 | -import com.baomidou.mybatisplus.core.metadata.IPage; | |
10 | -import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; | |
11 | -import com.baomidou.mybatisplus.core.toolkit.StringUtils; | |
12 | -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | |
13 | -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | |
14 | -import com.github.stupdit1t.excel.common.PoiWorkbookType; | |
15 | -import com.github.stupdit1t.excel.core.ExcelHelper; | |
16 | -import com.github.stupdit1t.excel.style.CellPosition; | |
17 | -import com.order.erp.common.constant.Constant; | |
18 | -import com.order.erp.common.constant.ServerResult; | |
19 | -import com.order.erp.common.constant.ServerResultCode; | |
20 | -import com.order.erp.common.excel4j.exceptions.Excel4JException; | |
21 | -import com.order.erp.common.exception.BusinessException; | |
22 | -import com.order.erp.common.utils.DateUtils; | |
23 | -import com.order.erp.common.utils.FileUtil; | |
24 | -import com.order.erp.common.utils.OrderFieldUtils; | |
25 | -import com.order.erp.common.utils.ProfitUtils; | |
26 | -import com.order.erp.config.DataScope; | |
27 | -import com.order.erp.domain.*; | |
28 | -import com.order.erp.domain.dto.BaseDO; | |
29 | -import com.order.erp.domain.dto.SystemSettingDO; | |
30 | -import com.order.erp.domain.dto.admin.AdminUserDO; | |
31 | -import com.order.erp.domain.dto.order.*; | |
32 | -import com.order.erp.domain.vo.order.*; | |
33 | -import com.order.erp.mapper.order.OrderBaseInfoMapper; | |
34 | -import com.order.erp.service.SystemSettingService; | |
35 | -import com.order.erp.service.admin.AdminUserService; | |
36 | -import com.order.erp.service.order.*; | |
37 | -import lombok.extern.slf4j.Slf4j; | |
38 | -import org.joda.time.DateTime; | |
39 | -import org.springframework.beans.BeanUtils; | |
40 | -import org.springframework.beans.factory.annotation.Value; | |
41 | -import org.springframework.stereotype.Service; | |
42 | -import org.springframework.transaction.annotation.Transactional; | |
43 | - | |
44 | -import javax.annotation.Resource; | |
45 | -import javax.servlet.http.HttpServletResponse; | |
46 | -import java.io.IOException; | |
47 | -import java.io.InputStream; | |
48 | -import java.math.BigDecimal; | |
49 | -import java.math.RoundingMode; | |
50 | -import java.net.URL; | |
51 | -import java.util.*; | |
52 | -import java.util.function.Function; | |
53 | -import java.util.stream.Collectors; | |
54 | - | |
55 | -/** | |
56 | - * 订单基础信息表(OrderBaseInfo)表服务实现类 | |
57 | - * | |
58 | - * @author makejava | |
59 | - * @since 2023-09-08 15:26:43 | |
60 | - */ | |
61 | -@Slf4j | |
62 | -@Service | |
63 | -public class OrderBaseInfoServiceImpl extends ServiceImpl<OrderBaseInfoMapper, OrderBaseInfoDO> implements OrderBaseInfoService { | |
64 | - | |
65 | - @Value("${file.path}") | |
66 | - private String path; | |
67 | - | |
68 | - @Value("${file.host}") | |
69 | - private String host; | |
70 | - | |
71 | - @Resource | |
72 | - private OrderProfitAnalysisService profitAnalysisService; | |
73 | - | |
74 | - @Resource | |
75 | - private OrderCompletionReportService reportService; | |
76 | - | |
77 | - @Resource | |
78 | - private OrderTrackStageService trackStageService; | |
79 | - | |
80 | - @Resource | |
81 | - private OrderInspectionStageService inspectionStageService; | |
82 | - | |
83 | - @Resource | |
84 | - private OrderFieldLockRecordService fieldLockRecordService; | |
85 | - | |
86 | - @Resource | |
87 | - private OrderFieldLockApplyService orderFieldLockApplyService; | |
88 | - | |
89 | - @Resource | |
90 | - private OrderAuditLogService orderAuditLogService; | |
91 | - | |
92 | - @Resource | |
93 | - private OrderCompletionReportService orderCompletionReportService; | |
94 | - | |
95 | - @Resource | |
96 | - private OrderInspectionStageService orderInspectionStageService; | |
97 | - | |
98 | - @Resource | |
99 | - private OrderOptLogService orderOptLogService; | |
100 | - | |
101 | - @Resource | |
102 | - private OrderFieldLockRecordService orderFieldLockRecordService; | |
103 | - | |
104 | - @Resource | |
105 | - private DataScope dataScope; | |
106 | - | |
107 | - @Resource | |
108 | - private AdminUserService userService; | |
109 | - | |
110 | - @Resource | |
111 | - private SystemSettingService systemSettingService; | |
112 | - | |
113 | - /** | |
114 | - * 通过ID查询单条数据 | |
115 | - * <p> | |
116 | - * orderBaseInfoQueryVO 主键 | |
117 | - * | |
118 | - * @return 实例对象 | |
119 | - */ | |
120 | - @Override | |
121 | - public ServerResult queryById(OrderBaseInfoQueryVO orderBaseInfoQueryVO) { | |
122 | - if (Objects.isNull(orderBaseInfoQueryVO.getId())) { | |
123 | - return ServerResult.fail("id 不能为空"); | |
124 | - } | |
125 | - OrderBaseInfoDO OrderBaseInfoDo = getById(orderBaseInfoQueryVO.getId()); | |
126 | - if (Objects.isNull(OrderBaseInfoDo)) { | |
127 | - return ServerResult.success(null); | |
128 | - } | |
129 | - return ServerResult.success(BeanUtil.copyProperties(OrderBaseInfoDo, OrderBaseInfoVO.class)); | |
130 | - } | |
131 | - | |
132 | - /** | |
133 | - * 分页查询 | |
134 | - * | |
135 | - * @param orderBaseInfoQueryVO 筛选条件 | |
136 | - * @return 查询结果 | |
137 | - */ | |
138 | - @Override | |
139 | - public ServerResult list(OrderBaseInfoQueryVO orderBaseInfoQueryVO) { | |
140 | - | |
141 | - return ServerResult.success(); | |
142 | - } | |
143 | - | |
144 | - @Override | |
145 | - public ServerResult check(OrderBaseInfoQueryVO orderBaseInfoQueryVO) { | |
146 | - List<OrderBaseInfoDO> orderBaseInfoDOS = list(new LambdaQueryWrapper<OrderBaseInfoDO>() | |
147 | - .in(CollectionUtils.isNotEmpty(orderBaseInfoQueryVO.getInnerNo()), OrderBaseInfoDO::getInnerNo, orderBaseInfoQueryVO.getInnerNo()) | |
148 | - .in(CollectionUtils.isNotEmpty(orderBaseInfoQueryVO.getCustomerStyle()), OrderBaseInfoDO::getCustomerStyle, orderBaseInfoQueryVO.getCustomerStyle())); | |
149 | - if (CollectionUtils.isNotEmpty(orderBaseInfoDOS)) { | |
150 | - throw new BusinessException("款式重复,是否继续"); | |
151 | - } | |
152 | - return ServerResult.success(); | |
153 | - } | |
154 | - | |
155 | - @Override | |
156 | - public ServerResult listByPage(OrderBaseInfoQueryVO queryVO) { | |
157 | - LambdaQueryWrapper<OrderBaseInfoDO> queryWrapper = buildQueryByParam(queryVO); | |
158 | - Page page = new Page<>(queryVO.getPage(), queryVO.getPageSize()); | |
159 | - IPage<OrderBaseInfoDO> iPage = page(page, queryWrapper); | |
160 | - | |
161 | - Page<OrderInfoResultVO> webVOPage = new Page<>(); | |
162 | - List<OrderBaseInfoDO> orderBaseInfoDOList = iPage.getRecords(); | |
163 | - webVOPage.setRecords(wrapperOrderResultList(true, orderBaseInfoDOList)); | |
164 | - BeanUtils.copyProperties(page, webVOPage, "records"); | |
165 | - return ServerResult.success(webVOPage); | |
166 | - } | |
167 | - | |
168 | - /** | |
169 | - * @param orderBaseInfoDOList | |
170 | - * @return | |
171 | - */ | |
172 | - @Override | |
173 | - public List<OrderInfoResultVO> wrapperOrderResultList(Boolean locked, List<OrderBaseInfoDO> orderBaseInfoDOList) { | |
174 | - List<OrderInfoResultVO> resultVOList = new ArrayList<>(); | |
175 | - if (CollectionUtils.isNotEmpty(orderBaseInfoDOList)) { | |
176 | - resultVOList = orderBaseInfoDOList.stream().map(x -> { | |
177 | - OrderInfoResultVO resultVO = new OrderInfoResultVO(); | |
178 | - BeanUtils.copyProperties(x, resultVO); | |
179 | - return resultVO; | |
180 | - }).collect(Collectors.toList()); | |
181 | - | |
182 | - // 填充利润分析 | |
183 | - fillProfitAnalysisInfo(resultVOList); | |
184 | - | |
185 | - // 填充项目报告 | |
186 | - fillReportInfo(resultVOList); | |
187 | - | |
188 | - // 填充跟单信息 | |
189 | - fillTrackStageInfo(resultVOList); | |
190 | - | |
191 | - // 填充质检信息 | |
192 | - fillInspectionStageInfo(resultVOList); | |
193 | - | |
194 | - if (locked) { | |
195 | - // 填充字段锁定信息 | |
196 | - fillLockFields(resultVOList); | |
197 | - // 查询是否编辑未生效字段 | |
198 | - fillOrderUpdateInfos(resultVOList); | |
199 | - } | |
200 | - | |
201 | - // 填充进度 | |
202 | - fillSchedules(resultVOList); | |
203 | - | |
204 | - } | |
205 | - return resultVOList; | |
206 | - } | |
207 | - | |
208 | - @Override | |
209 | - public void export(HttpServletResponse response, OrderBaseInfoQueryVO queryVO) throws IOException, Excel4JException { | |
210 | - OrderLockFieldVO lockFieldVO = queryVO.getFieldVO(); | |
211 | - if (Objects.isNull(lockFieldVO)) { | |
212 | - throw new BusinessException("请选择要导出的列!"); | |
213 | - } | |
214 | - List<OrderBaseInfoDO> orderBaseInfoDOList = new ArrayList<>(); | |
215 | - if (!Objects.isNull(queryVO.getFieldVO()) && !CollectionUtils.isEmpty(queryVO.getFieldVO().getOrderIds())) { | |
216 | - orderBaseInfoDOList = listByIds(queryVO.getFieldVO().getOrderIds()); | |
217 | - } else { | |
218 | - LambdaQueryWrapper<OrderBaseInfoDO> queryWrapper = buildQueryByParam(queryVO); | |
219 | - orderBaseInfoDOList = list(queryWrapper); | |
220 | - } | |
221 | - | |
222 | - if (CollectionUtils.isNotEmpty(orderBaseInfoDOList)) { | |
223 | - List<OrderInfoResultVO> resultVOList = orderBaseInfoDOList.stream().map(x -> { | |
224 | - OrderInfoResultVO resultVO = new OrderInfoResultVO(); | |
225 | - BeanUtils.copyProperties(x, resultVO); | |
226 | - return resultVO; | |
227 | - }).collect(Collectors.toList()); | |
228 | - | |
229 | - | |
230 | - if (Objects.nonNull(lockFieldVO.getProfitAnalysisFields())) { | |
231 | - // 填充利润分析 | |
232 | - fillProfitAnalysisInfo(resultVOList); | |
233 | - } | |
234 | - | |
235 | - if (Objects.nonNull(lockFieldVO.getReportFields())) { | |
236 | - // 填充项目报告 | |
237 | - fillReportInfo(resultVOList); | |
238 | - } | |
239 | - | |
240 | - if (Objects.nonNull(lockFieldVO.getTrackStageFields())) { | |
241 | - // 填充跟单信息 | |
242 | - fillTrackStageInfo(resultVOList); | |
243 | - } | |
244 | - | |
245 | - if (Objects.nonNull(lockFieldVO.getInspectionStageFields())) { | |
246 | - // 填充质检信息 | |
247 | - fillInspectionStageInfo(resultVOList); | |
248 | - } | |
249 | - | |
250 | - if (CollectionUtils.isNotEmpty(resultVOList)) { | |
251 | - List<Map<String, Object>> list = buildExportMapVOS(resultVOList, lockFieldVO); | |
252 | - if (CollectionUtils.isNotEmpty(list)) { | |
253 | - List<String> keys = new ArrayList<>(list.get(Constant.ZERO).keySet()); | |
254 | - | |
255 | - ExcelHelper.opsExport(PoiWorkbookType.XLSX) | |
256 | - .opsSheet(list) | |
257 | - .opsHeader().simple().texts(keys).done() | |
258 | - .opsColumn().fields(keys).done() | |
259 | - .height(CellPosition.CELL, 750) | |
260 | - .done() | |
261 | - .export(response.getOutputStream()); | |
262 | - } | |
263 | - } | |
264 | - } | |
265 | - } | |
266 | - | |
267 | - /** | |
268 | - * @param resultVOList | |
269 | - * @param lockFieldVO | |
270 | - * @return | |
271 | - */ | |
272 | - private List<Map<String, Object>> buildExportMapVOS(List<OrderInfoResultVO> resultVOList, OrderLockFieldVO lockFieldVO) throws IOException { | |
273 | - List<Map<String, Object>> list = new ArrayList<>(); | |
274 | - for (OrderInfoResultVO orderInfoResultVO : resultVOList) { | |
275 | - Map<String, Object> map = new LinkedHashMap<>(); | |
276 | - OrderBaseFieldVO baseFields = lockFieldVO.getBaseFields(); | |
277 | - OrderProfitAnalysisFieldVO profitAnalysisFields = lockFieldVO.getProfitAnalysisFields(); | |
278 | - OrderCompletionReportFieldVO reportFields = lockFieldVO.getReportFields(); | |
279 | - OrderTrackStageFieldVO trackStageFields = lockFieldVO.getTrackStageFields(); | |
280 | - OrderInspectionStageFieldVO inspectionStageFields = lockFieldVO.getInspectionStageFields(); | |
281 | - if (Objects.nonNull(baseFields)) { | |
282 | - if (StringUtils.isNotBlank(baseFields.getCustomerCode()) && | |
283 | - OrderLockFieldEnum.SELECTED.getStatus().equals(baseFields.getCustomerCode())) { | |
284 | - map.put("客户编码", orderInfoResultVO.getCustomerCode()); | |
285 | - } | |
286 | - if (StringUtils.isNotBlank(baseFields.getProjectNo()) && | |
287 | - OrderLockFieldEnum.SELECTED.getStatus().equals(baseFields.getProjectNo())) { | |
288 | - map.put("项目号", orderInfoResultVO.getProjectNo()); | |
289 | - } | |
290 | - if (StringUtils.isNotBlank(baseFields.getProductionDepartment()) && | |
291 | - OrderLockFieldEnum.SELECTED.getStatus().equals(baseFields.getProductionDepartment())) { | |
292 | - map.put("生产科", orderInfoResultVO.getProductionDepartment()); | |
293 | - } | |
294 | - if (StringUtils.isNotBlank(baseFields.getInnerNo()) && | |
295 | - OrderLockFieldEnum.SELECTED.getStatus().equals(baseFields.getInnerNo())) { | |
296 | - map.put("内部编号", orderInfoResultVO.getInnerNo()); | |
297 | - } | |
298 | - if (StringUtils.isNotBlank(baseFields.getCustomerPo()) && | |
299 | - OrderLockFieldEnum.SELECTED.getStatus().equals(baseFields.getCustomerPo())) { | |
300 | - map.put("客户po号", orderInfoResultVO.getCustomerPo()); | |
301 | - } | |
302 | - if (StringUtils.isNotBlank(baseFields.getCustomerStyle()) && | |
303 | - OrderLockFieldEnum.SELECTED.getStatus().equals(baseFields.getCustomerStyle())) { | |
304 | - map.put("客户STYLE#", orderInfoResultVO.getCustomerStyle()); | |
305 | - } | |
306 | - if (StringUtils.isNotBlank(baseFields.getModeleLo()) && | |
307 | - OrderLockFieldEnum.SELECTED.getStatus().equals(baseFields.getModeleLo())) { | |
308 | - map.put("Modelo(REFERENCE)", orderInfoResultVO.getModeleLo()); | |
309 | - } | |
310 | - if (StringUtils.isNotBlank(baseFields.getCollection()) && | |
311 | - OrderLockFieldEnum.SELECTED.getStatus().equals(baseFields.getCollection())) { | |
312 | - map.put("COLLECTION (style description)", orderInfoResultVO.getCollection()); | |
313 | - } | |
314 | - if (StringUtils.isNotBlank(baseFields.getPoColor()) && | |
315 | - OrderLockFieldEnum.SELECTED.getStatus().equals(baseFields.getPoColor())) { | |
316 | - map.put("PO COLOR", orderInfoResultVO.getPoColor()); | |
317 | - } | |
318 | - if (StringUtils.isNotBlank(baseFields.getPicUrl()) && | |
319 | - OrderLockFieldEnum.SELECTED.getStatus().equals(baseFields.getPicUrl())) { | |
320 | - if (StringUtils.isNotBlank(orderInfoResultVO.getSmallPicUrl())) { | |
321 | - URL url = new URL(orderInfoResultVO.getSmallPicUrl()); | |
322 | - InputStream inputStream = url.openStream(); | |
323 | - map.put("订单图片", FileUtil.imageParseBytes(inputStream)); | |
324 | - } else { | |
325 | - map.put("订单图片", ""); | |
326 | - } | |
327 | - } | |
328 | - if (StringUtils.isNotBlank(baseFields.getCnColor()) && | |
329 | - OrderLockFieldEnum.SELECTED.getStatus().equals(baseFields.getCnColor())) { | |
330 | - map.put("颜色中文", orderInfoResultVO.getCnColor()); | |
331 | - } | |
332 | - if (StringUtils.isNotBlank(baseFields.getProductionComment()) && | |
333 | - OrderLockFieldEnum.SELECTED.getStatus().equals(baseFields.getProductionComment())) { | |
334 | - map.put("生产要求", orderInfoResultVO.getProductionComment()); | |
335 | - } | |
336 | - if (StringUtils.isNotBlank(baseFields.getOrderCount()) && | |
337 | - OrderLockFieldEnum.SELECTED.getStatus().equals(baseFields.getOrderCount())) { | |
338 | - map.put("数量", orderInfoResultVO.getOrderCount()); | |
339 | - } | |
340 | - if (StringUtils.isNotBlank(baseFields.getOrderComposition()) && | |
341 | - OrderLockFieldEnum.SELECTED.getStatus().equals(baseFields.getOrderComposition())) { | |
342 | - map.put("订单成分", orderInfoResultVO.getOrderComposition()); | |
343 | - } | |
344 | - if (StringUtils.isNotBlank(baseFields.getProductStyle()) && | |
345 | - OrderLockFieldEnum.SELECTED.getStatus().equals(baseFields.getProductStyle())) { | |
346 | - map.put("款式类型", orderInfoResultVO.getProductStyle()); | |
347 | - } | |
348 | - if (StringUtils.isNotBlank(baseFields.getProductionDepartmentConsignTime()) && | |
349 | - OrderLockFieldEnum.SELECTED.getStatus().equals(baseFields.getProductionDepartmentConsignTime())) { | |
350 | - try { | |
351 | - map.put("生产科拖货时间", StringUtils.isBlank(orderInfoResultVO.getProductionDepartmentConsignTime()) ? | |
352 | - orderInfoResultVO.getProductionDepartmentConsignTime() : | |
353 | - DateUtils.format(DateUtils.parseDate(orderInfoResultVO.getProductionDepartmentConsignTime(), DateUtils.DATE_TIME), DateUtils.DATE)); | |
354 | - } catch (Exception e) { | |
355 | - map.put("生产科拖货时间", orderInfoResultVO.getProductionDepartmentConsignTime()); | |
356 | - } | |
357 | - } | |
358 | - if (StringUtils.isNotBlank(baseFields.getOrderHodTime()) && | |
359 | - OrderLockFieldEnum.SELECTED.getStatus().equals(baseFields.getOrderHodTime())) { | |
360 | - try { | |
361 | - map.put("订单上HOD时间", StringUtils.isBlank(orderInfoResultVO.getOrderHodTime()) ? | |
362 | - orderInfoResultVO.getOrderHodTime() : | |
363 | - DateUtils.format(DateUtils.parseDate(orderInfoResultVO.getOrderHodTime(), DateUtils.DATE_TIME), DateUtils.DATE)); | |
364 | - } catch (Exception e) { | |
365 | - map.put("订单上HOD时间", orderInfoResultVO.getOrderHodTime()); | |
366 | - } | |
367 | - } | |
368 | - if (StringUtils.isNotBlank(baseFields.getOutboundType()) && | |
369 | - OrderLockFieldEnum.SELECTED.getStatus().equals(baseFields.getOutboundType())) { | |
370 | - map.put("出库类型", orderInfoResultVO.getOutboundType()); | |
371 | - } | |
372 | - if (StringUtils.isNotBlank(baseFields.getPacketType()) && | |
373 | - OrderLockFieldEnum.SELECTED.getStatus().equals(baseFields.getPacketType())) { | |
374 | - map.put("包装类型", orderInfoResultVO.getPacketType()); | |
375 | - } | |
376 | - } | |
377 | - OrderProfitAnalysisVO profitAnalysisVO = Objects.nonNull(orderInfoResultVO.getProfitAnalysisInfo()) ? | |
378 | - orderInfoResultVO.getProfitAnalysisInfo() : new OrderProfitAnalysisVO(); | |
379 | - if (Objects.nonNull(profitAnalysisFields)) { | |
380 | - if (StringUtils.isNotBlank(profitAnalysisFields.getCustomerPrice()) && | |
381 | - OrderLockFieldEnum.SELECTED.getStatus().equals(profitAnalysisFields.getCustomerPrice())) { | |
382 | - map.put("客户单价$", profitAnalysisVO.getCustomerPrice()); | |
383 | - } | |
384 | - if (StringUtils.isNotBlank(profitAnalysisFields.getCustomerTotalPrice()) && | |
385 | - OrderLockFieldEnum.SELECTED.getStatus().equals(profitAnalysisFields.getCustomerTotalPrice())) { | |
386 | - map.put("客户总价$", profitAnalysisVO.getCustomerTotalPrice()); | |
387 | - } | |
388 | - if (StringUtils.isNotBlank(profitAnalysisFields.getCustomerRmbPrice()) && | |
389 | - OrderLockFieldEnum.SELECTED.getStatus().equals(profitAnalysisFields.getCustomerRmbPrice())) { | |
390 | - map.put("客户单价¥", profitAnalysisVO.getCustomerRmbPrice()); | |
391 | - } | |
392 | - if (StringUtils.isNotBlank(profitAnalysisFields.getCustomerRmbTotalPrice()) && | |
393 | - OrderLockFieldEnum.SELECTED.getStatus().equals(profitAnalysisFields.getCustomerRmbTotalPrice())) { | |
394 | - map.put("客户总价¥", profitAnalysisVO.getCustomerRmbTotalPrice()); | |
395 | - } | |
396 | - if (StringUtils.isNotBlank(profitAnalysisFields.getProductionDepartmentPrice()) && | |
397 | - OrderLockFieldEnum.SELECTED.getStatus().equals(profitAnalysisFields.getProductionDepartmentPrice())) { | |
398 | - map.put("生产科单价¥", profitAnalysisVO.getProductionDepartmentPrice()); | |
399 | - } | |
400 | - if (StringUtils.isNotBlank(profitAnalysisFields.getProductionDepartmentTotalPrice()) && | |
401 | - OrderLockFieldEnum.SELECTED.getStatus().equals(profitAnalysisFields.getProductionDepartmentTotalPrice())) { | |
402 | - map.put("生产科总价¥", profitAnalysisVO.getProductionDepartmentTotalPrice()); | |
403 | - } | |
404 | - if (StringUtils.isNotBlank(profitAnalysisFields.getPacketPrice()) && | |
405 | - OrderLockFieldEnum.SELECTED.getStatus().equals(profitAnalysisFields.getPacketPrice())) { | |
406 | - map.put("包装费用$", profitAnalysisVO.getPacketPrice()); | |
407 | - } | |
408 | - if (StringUtils.isNotBlank(profitAnalysisFields.getPacketTotalPrice()) && | |
409 | - OrderLockFieldEnum.SELECTED.getStatus().equals(profitAnalysisFields.getPacketTotalPrice())) { | |
410 | - map.put("包装费用合计$", profitAnalysisVO.getPacketTotalPrice()); | |
411 | - } | |
412 | - if (StringUtils.isNotBlank(profitAnalysisFields.getExchangeRate()) && | |
413 | - OrderLockFieldEnum.SELECTED.getStatus().equals(profitAnalysisFields.getExchangeRate())) { | |
414 | - map.put("汇率", profitAnalysisVO.getExchangeRate()); | |
415 | - } | |
416 | - if (StringUtils.isNotBlank(profitAnalysisFields.getProfitRate()) && | |
417 | - OrderLockFieldEnum.SELECTED.getStatus().equals(profitAnalysisFields.getProfitRate())) { | |
418 | - map.put("利润率", profitAnalysisVO.getProfitRate()); | |
419 | - } | |
420 | - } | |
421 | - OrderCompletionReportVO reportInfo = Objects.nonNull(orderInfoResultVO.getReportInfo()) ? | |
422 | - orderInfoResultVO.getReportInfo() : new OrderCompletionReportVO(); | |
423 | - if (Objects.nonNull(reportFields) && Objects.nonNull(reportInfo)) { | |
424 | - if (StringUtils.isNotBlank(reportFields.getIdeaSource()) && | |
425 | - OrderLockFieldEnum.SELECTED.getStatus().equals(reportFields.getIdeaSource())) { | |
426 | - map.put("想法来源", reportInfo.getIdeaSource()); | |
427 | - } | |
428 | - if (StringUtils.isNotBlank(reportFields.getIdeaSourceRate()) && | |
429 | - OrderLockFieldEnum.SELECTED.getStatus().equals(reportFields.getIdeaSourceRate())) { | |
430 | - map.put("想法来源占比", reportInfo.getIdeaSourceRate()); | |
431 | - } | |
432 | - if (StringUtils.isNotBlank(reportFields.getManualPreform1()) && | |
433 | - OrderLockFieldEnum.SELECTED.getStatus().equals(reportFields.getManualPreform1())) { | |
434 | - map.put("手工初型1", reportInfo.getManualPreform1()); | |
435 | - } | |
436 | - if (StringUtils.isNotBlank(reportFields.getManualPreform1Rate()) && | |
437 | - OrderLockFieldEnum.SELECTED.getStatus().equals(reportFields.getManualPreform1Rate())) { | |
438 | - map.put("手工初型1占比", reportInfo.getManualPreform1Rate()); | |
439 | - } | |
440 | - if (StringUtils.isNotBlank(reportFields.getManualPreform2()) && | |
441 | - OrderLockFieldEnum.SELECTED.getStatus().equals(reportFields.getManualPreform2())) { | |
442 | - map.put("手工初型2", reportInfo.getManualPreform2()); | |
443 | - } | |
444 | - if (StringUtils.isNotBlank(reportFields.getManualPreform2Rate()) && | |
445 | - OrderLockFieldEnum.SELECTED.getStatus().equals(reportFields.getManualPreform2Rate())) { | |
446 | - map.put("手工初型2占比", reportInfo.getManualPreform2Rate()); | |
447 | - } | |
448 | - | |
449 | - } | |
450 | - OrderTrackStageVO trackStageInfo = Objects.nonNull(orderInfoResultVO.getTrackStageInfo()) ? | |
451 | - orderInfoResultVO.getTrackStageInfo() : new OrderTrackStageVO(); | |
452 | - if (Objects.nonNull(trackStageFields) && Objects.nonNull(trackStageInfo)) { | |
453 | - if (StringUtils.isNotBlank(trackStageFields.getPpTime()) && | |
454 | - OrderLockFieldEnum.SELECTED.getStatus().equals(trackStageFields.getPpTime())) { | |
455 | - try { | |
456 | - map.put("pp date", StringUtils.isBlank(trackStageInfo.getPpTime()) ? | |
457 | - trackStageInfo.getPpTime() : | |
458 | - DateUtils.format(DateUtils.parseDate(trackStageInfo.getPpTime(), DateUtils.DATE_TIME), DateUtils.DATE)); | |
459 | - } catch (Exception e) { | |
460 | - map.put("pp date", trackStageInfo.getPpTime()); | |
461 | - } | |
462 | - } | |
463 | - if (StringUtils.isNotBlank(trackStageFields.getPpConfirmResult()) && | |
464 | - OrderLockFieldEnum.SELECTED.getStatus().equals(trackStageFields.getPpConfirmResult())) { | |
465 | - map.put("pp样品确认意见", trackStageInfo.getPpConfirmResult()); | |
466 | - } | |
467 | - if (StringUtils.isNotBlank(trackStageFields.getEsoSampleSendTime()) && | |
468 | - OrderLockFieldEnum.SELECTED.getStatus().equals(trackStageFields.getEsoSampleSendTime())) { | |
469 | - try { | |
470 | - map.put("EXTRA,SHOWROOM,ONLINE sample发送时间", StringUtils.isBlank(trackStageInfo.getEsoSampleSendTime()) ? | |
471 | - trackStageInfo.getEsoSampleSendTime() : | |
472 | - DateUtils.format(DateUtils.parseDate(trackStageInfo.getEsoSampleSendTime(), DateUtils.DATE_TIME), DateUtils.DATE)); | |
473 | - } catch (Exception e) { | |
474 | - map.put("EXTRA,SHOWROOM,ONLINE sample发送时间", trackStageInfo.getEsoSampleSendTime()); | |
475 | - } | |
476 | - } | |
477 | - if (StringUtils.isNotBlank(trackStageFields.getShippmentSampleSendTime()) && | |
478 | - OrderLockFieldEnum.SELECTED.getStatus().equals(trackStageFields.getShippmentSampleSendTime())) { | |
479 | - try { | |
480 | - map.put("shippment sample 发送时间", StringUtils.isBlank(trackStageInfo.getShippmentSampleSendTime()) ? | |
481 | - trackStageInfo.getShippmentSampleSendTime() : | |
482 | - DateUtils.format(DateUtils.parseDate(trackStageInfo.getShippmentSampleSendTime(), DateUtils.DATE_TIME), DateUtils.DATE)); | |
483 | - | |
484 | - } catch (Exception e) { | |
485 | - map.put("shippment sample 发送时间", trackStageInfo.getShippmentSampleSendTime()); | |
486 | - | |
487 | - } | |
488 | - } | |
489 | - if (StringUtils.isNotBlank(trackStageFields.getShippmentSampleConfirmResult()) && | |
490 | - OrderLockFieldEnum.SELECTED.getStatus().equals(trackStageFields.getShippmentSampleConfirmResult())) { | |
491 | - map.put("shipment sample确认意见", trackStageInfo.getShippmentSampleConfirmResult()); | |
492 | - } | |
493 | - if (StringUtils.isNotBlank(trackStageFields.getSelfTestPassTime()) && | |
494 | - OrderLockFieldEnum.SELECTED.getStatus().equals(trackStageFields.getSelfTestPassTime())) { | |
495 | - try { | |
496 | - map.put("自测通过时间", StringUtils.isBlank(trackStageInfo.getSelfTestPassTime()) ? | |
497 | - trackStageInfo.getSelfTestPassTime() : | |
498 | - DateUtils.format(DateUtils.parseDate(trackStageInfo.getSelfTestPassTime(), DateUtils.DATE_TIME), DateUtils.DATE)); | |
499 | - } catch (Exception e) { | |
500 | - map.put("自测通过时间", trackStageInfo.getSelfTestPassTime()); | |
501 | - } | |
502 | - } | |
503 | - if (StringUtils.isNotBlank(trackStageFields.getAitexTestSendTime()) && | |
504 | - OrderLockFieldEnum.SELECTED.getStatus().equals(trackStageFields.getAitexTestSendTime())) { | |
505 | - try { | |
506 | - map.put("Aitex测试发送时间", StringUtils.isBlank(trackStageInfo.getAitexTestSendTime()) ? | |
507 | - trackStageInfo.getAitexTestSendTime() : | |
508 | - DateUtils.format(DateUtils.parseDate(trackStageInfo.getAitexTestSendTime(), DateUtils.DATE_TIME), DateUtils.DATE)); | |
509 | - } catch (Exception e) { | |
510 | - map.put("Aitex测试发送时间", trackStageInfo.getAitexTestSendTime()); | |
511 | - } | |
512 | - } | |
513 | - if (StringUtils.isNotBlank(trackStageFields.getAitexTestFinishResult()) && | |
514 | - OrderLockFieldEnum.SELECTED.getStatus().equals(trackStageFields.getAitexTestFinishResult())) { | |
515 | - map.put("Aitex测试结果", trackStageInfo.getAitexTestFinishResult()); | |
516 | - } | |
517 | - if (StringUtils.isNotBlank(trackStageFields.getSgsTestSendTime()) && | |
518 | - OrderLockFieldEnum.SELECTED.getStatus().equals(trackStageFields.getSgsTestSendTime())) { | |
519 | - try { | |
520 | - map.put("SGS测试发送时间", StringUtils.isBlank(trackStageInfo.getSgsTestSendTime()) ? | |
521 | - trackStageInfo.getSgsTestSendTime() : | |
522 | - DateUtils.format(DateUtils.parseDate(trackStageInfo.getSgsTestSendTime(), DateUtils.DATE_TIME), DateUtils.DATE)); | |
523 | - } catch (Exception e) { | |
524 | - map.put("SGS测试发送时间", trackStageInfo.getSgsTestSendTime()); | |
525 | - } | |
526 | - } | |
527 | - if (StringUtils.isNotBlank(trackStageFields.getSgsTestFinishResult()) && | |
528 | - OrderLockFieldEnum.SELECTED.getStatus().equals(trackStageFields.getSgsTestFinishResult())) { | |
529 | - map.put("SGS测试结果", trackStageInfo.getSgsTestFinishResult()); | |
530 | - } | |
531 | - if (StringUtils.isNotBlank(trackStageFields.getBarcodeStickerArrivalTime()) && | |
532 | - OrderLockFieldEnum.SELECTED.getStatus().equals(trackStageFields.getBarcodeStickerArrivalTime())) { | |
533 | - try { | |
534 | - map.put("Barcode sticker arrival time", StringUtils.isBlank(trackStageInfo.getBarcodeStickerArrivalTime()) ? | |
535 | - trackStageInfo.getBarcodeStickerArrivalTime() : | |
536 | - DateUtils.format(DateUtils.parseDate(trackStageInfo.getBarcodeStickerArrivalTime(), DateUtils.DATE_TIME), DateUtils.DATE)); | |
537 | - } catch (Exception e) { | |
538 | - map.put("Barcode sticker arrival time", trackStageInfo.getBarcodeStickerArrivalTime()); | |
539 | - } | |
540 | - } | |
541 | - if (StringUtils.isNotBlank(trackStageFields.getLatestArrivalTime()) && | |
542 | - OrderLockFieldEnum.SELECTED.getStatus().equals(trackStageFields.getLatestArrivalTime())) { | |
543 | - try { | |
544 | - map.put("最晚包材到货时间", StringUtils.isBlank(trackStageInfo.getLatestArrivalTime()) ? | |
545 | - trackStageInfo.getLatestArrivalTime() : | |
546 | - DateUtils.format(DateUtils.parseDate(trackStageInfo.getLatestArrivalTime(), DateUtils.DATE_TIME), DateUtils.DATE)); | |
547 | - } catch (Exception e) { | |
548 | - map.put("最晚包材到货时间", trackStageInfo.getLatestArrivalTime()); | |
549 | - } | |
550 | - } | |
551 | - if (StringUtils.isNotBlank(trackStageFields.getLatestBkTime()) && | |
552 | - OrderLockFieldEnum.SELECTED.getStatus().equals(trackStageFields.getLatestBkTime())) { | |
553 | - try { | |
554 | - map.put("最晚订舱+报关资料时间", StringUtils.isBlank(trackStageInfo.getLatestBkTime()) ? | |
555 | - trackStageInfo.getLatestBkTime() : | |
556 | - DateUtils.format(DateUtils.parseDate(trackStageInfo.getLatestBkTime(), DateUtils.DATE_TIME), DateUtils.DATE)); | |
557 | - } catch (Exception e) { | |
558 | - map.put("最晚订舱+报关资料时间", trackStageInfo.getLatestBkTime()); | |
559 | - | |
560 | - } | |
561 | - } | |
562 | - } | |
563 | - OrderInspectionStageVO inspectionStageInfo = Objects.nonNull(orderInfoResultVO.getInspectionStageInfo()) ? | |
564 | - orderInfoResultVO.getInspectionStageInfo() : new OrderInspectionStageVO(); | |
565 | - if (Objects.nonNull(inspectionStageFields) && Objects.nonNull(inspectionStageInfo)) { | |
566 | - if (StringUtils.isNotBlank(inspectionStageFields.getMidCheckApplyTime()) && | |
567 | - OrderLockFieldEnum.SELECTED.getStatus().equals(inspectionStageFields.getMidCheckApplyTime())) { | |
568 | - try { | |
569 | - map.put("中期验货申请时间", StringUtils.isBlank(inspectionStageInfo.getMidCheckApplyTime()) ? | |
570 | - inspectionStageInfo.getMidCheckApplyTime() : | |
571 | - DateUtils.format(DateUtils.parseDate(inspectionStageInfo.getMidCheckApplyTime(), DateUtils.DATE_TIME), DateUtils.DATE)); | |
572 | - } catch (Exception e) { | |
573 | - map.put("中期验货申请时间", inspectionStageInfo.getMidCheckApplyTime()); | |
574 | - } | |
575 | - } | |
576 | - if (StringUtils.isNotBlank(inspectionStageFields.getMidCheckComment()) && | |
577 | - OrderLockFieldEnum.SELECTED.getStatus().equals(inspectionStageFields.getMidCheckComment())) { | |
578 | - map.put("中期验货(功能性-拉力/跌落等、外观性-颜色/规格等、耐久性-烤厅等)", inspectionStageInfo.getMidCheckComment()); | |
579 | - } | |
580 | - if (StringUtils.isNotBlank(inspectionStageFields.getMidCheckResult()) && | |
581 | - OrderLockFieldEnum.SELECTED.getStatus().equals(inspectionStageFields.getMidCheckResult())) { | |
582 | - map.put("中期验货结果PASS / FAIL", inspectionStageInfo.getMidCheckResult()); | |
583 | - } | |
584 | - if (StringUtils.isNotBlank(inspectionStageFields.getEndCheckApplyTime()) && | |
585 | - OrderLockFieldEnum.SELECTED.getStatus().equals(inspectionStageFields.getEndCheckApplyTime())) { | |
586 | - try { | |
587 | - map.put("尾期验货申请时间", StringUtils.isBlank(inspectionStageInfo.getEndCheckApplyTime()) ? | |
588 | - inspectionStageInfo.getEndCheckApplyTime() : | |
589 | - DateUtils.format(DateUtils.parseDate(inspectionStageInfo.getEndCheckApplyTime(), DateUtils.DATE_TIME), DateUtils.DATE)); | |
590 | - } catch (Exception e) { | |
591 | - map.put("尾期验货申请时间", inspectionStageInfo.getEndCheckApplyTime()); | |
592 | - } | |
593 | - } | |
594 | - if (StringUtils.isNotBlank(inspectionStageFields.getSpecification()) && | |
595 | - OrderLockFieldEnum.SELECTED.getStatus().equals(inspectionStageFields.getSpecification())) { | |
596 | - map.put("长度/规格", inspectionStageInfo.getSpecification()); | |
597 | - } | |
598 | - if (StringUtils.isNotBlank(inspectionStageFields.getFunctionality()) && | |
599 | - OrderLockFieldEnum.SELECTED.getStatus().equals(inspectionStageFields.getFunctionality())) { | |
600 | - map.put("功能性不良", inspectionStageInfo.getFunctionality()); | |
601 | - } | |
602 | - if (StringUtils.isNotBlank(inspectionStageFields.getElectroplate()) && | |
603 | - OrderLockFieldEnum.SELECTED.getStatus().equals(inspectionStageFields.getElectroplate())) { | |
604 | - map.put("电镀不良", inspectionStageInfo.getElectroplate()); | |
605 | - } | |
606 | - if (StringUtils.isNotBlank(inspectionStageFields.getValue1()) && | |
607 | - OrderLockFieldEnum.SELECTED.getStatus().equals(inspectionStageFields.getValue1())) { | |
608 | - map.put("不良1", inspectionStageInfo.getValue1()); | |
609 | - } | |
610 | - if (StringUtils.isNotBlank(inspectionStageFields.getValue2()) && | |
611 | - OrderLockFieldEnum.SELECTED.getStatus().equals(inspectionStageFields.getValue2())) { | |
612 | - map.put("不良2", inspectionStageInfo.getValue2()); | |
613 | - } | |
614 | - if (StringUtils.isNotBlank(inspectionStageFields.getValue3()) && | |
615 | - OrderLockFieldEnum.SELECTED.getStatus().equals(inspectionStageFields.getValue3())) { | |
616 | - map.put("不良3", inspectionStageInfo.getValue3()); | |
617 | - } | |
618 | - if (StringUtils.isNotBlank(inspectionStageFields.getBoxPacket()) && | |
619 | - OrderLockFieldEnum.SELECTED.getStatus().equals(inspectionStageFields.getBoxPacket())) { | |
620 | - map.put("包装:卡片、条码、箱贴,箱单", inspectionStageInfo.getBoxPacket()); | |
621 | - } | |
622 | - if (StringUtils.isNotBlank(inspectionStageFields.getEndCheckResult()) && | |
623 | - OrderLockFieldEnum.SELECTED.getStatus().equals(inspectionStageFields.getEndCheckResult())) { | |
624 | - map.put("尾期验货结果PASS / FAIL", inspectionStageInfo.getEndCheckResult()); | |
625 | - } | |
626 | - } | |
627 | - list.add(map); | |
628 | - } | |
629 | - | |
630 | - return list; | |
631 | - } | |
632 | - | |
633 | - @Override | |
634 | - public ServerResult fieldUnlockApply(OrderUnlockFieldApplyVO fieldVO) { | |
635 | - Long userId = dataScope.getLoginUserId(); | |
636 | - checkApply(fieldVO, userId); | |
637 | - | |
638 | - OrderFieldLockApplyDO applyDO = initOrderFieldLockApplyDO(fieldVO, userId); | |
639 | - List<OrderFieldLockApplyDO> applyDOList = OrderFieldUtils.initOrderFieldLockApplyDOS(fieldVO, userId); | |
640 | - if (CollectionUtils.isNotEmpty(applyDOList)) { | |
641 | - orderFieldLockApplyService.saveBatch(applyDOList); | |
642 | - } | |
643 | - | |
644 | - orderOptLogService.save(buildOrderOptLogDo(fieldVO.getOrderId(), userId, OrderOptTypeEnum.ORDER_FIELD_UNLOCK_APPLY.getDesc(), applyDO.getFields())); | |
645 | - return ServerResult.success(); | |
646 | - } | |
647 | - | |
648 | - /** | |
649 | - * @param fieldVO | |
650 | - * @param userId | |
651 | - */ | |
652 | - private void checkApply(OrderUnlockFieldApplyVO fieldVO, Long userId) { | |
653 | - List<OrderFieldLockApplyDO> applyDOS = orderFieldLockApplyService.list(new LambdaQueryWrapper<OrderFieldLockApplyDO>() | |
654 | - .eq(BaseDO::getEnableFlag, Constant.ENABLE_TEN) | |
655 | - .eq(OrderFieldLockApplyDO::getOrderId, fieldVO.getOrderId()) | |
656 | - .eq(OrderFieldLockApplyDO::getApplyUserId, userId) | |
657 | - .eq(OrderFieldLockApplyDO::getType, ApplyTypeEnum.FIELD_EDIT_APPLY.getType()) | |
658 | - .eq(OrderFieldLockApplyDO::getStatus, ApplyStatusEnum.WAIT_AUDIT.getStatus())); | |
659 | - if (CollectionUtils.isNotEmpty(applyDOS)) { | |
660 | - throw new BusinessException(ServerResultCode.APPLY_UNLOCK_FIELD_EXIST); | |
661 | - } | |
662 | - } | |
663 | - | |
664 | - /** | |
665 | - * @param orderId | |
666 | - * @param userId | |
667 | - */ | |
668 | - private void checkApply(Long orderId, Long userId, ApplyTypeEnum applyTypeEnum) { | |
669 | - List<OrderFieldLockApplyDO> applyDOS = orderFieldLockApplyService.list(new LambdaQueryWrapper<OrderFieldLockApplyDO>() | |
670 | - .eq(BaseDO::getEnableFlag, Constant.ENABLE_TEN) | |
671 | - .eq(OrderFieldLockApplyDO::getOrderId, orderId) | |
672 | - .eq(OrderFieldLockApplyDO::getApplyUserId, userId) | |
673 | - .eq(OrderFieldLockApplyDO::getType, applyTypeEnum.getType()) | |
674 | - .eq(OrderFieldLockApplyDO::getStatus, ApplyStatusEnum.WAIT_AUDIT.getStatus())); | |
675 | - if (CollectionUtils.isNotEmpty(applyDOS)) { | |
676 | - throw new BusinessException(ServerResultCode.APPLY_UNLOCK_FIELD_EXIST); | |
677 | - } | |
678 | - } | |
679 | - | |
680 | - | |
681 | - /** | |
682 | - * @param fieldVO | |
683 | - * @param userId | |
684 | - * @return | |
685 | - */ | |
686 | - private OrderFieldLockApplyDO initOrderFieldLockApplyDO(OrderUnlockFieldApplyVO fieldVO, Long userId) { | |
687 | - OrderLockFieldVO lockFieldVO = new OrderLockFieldVO(); | |
688 | - BeanUtils.copyProperties(fieldVO, lockFieldVO); | |
689 | - return OrderFieldLockApplyDO.builder() | |
690 | - .applyUserId(userId) | |
691 | - .auditUserId(null) | |
692 | - .fields(JSONObject.toJSONString(lockFieldVO)) | |
693 | - .orderId(fieldVO.getOrderId()) | |
694 | - .type(ApplyTypeEnum.FIELD_EDIT_APPLY.getType()) | |
695 | - .remark(ApplyTypeEnum.FIELD_EDIT_APPLY.getDesc()) | |
696 | - .status(ApplyStatusEnum.WAIT_AUDIT.getStatus()) | |
697 | - .build(); | |
698 | - } | |
699 | - | |
700 | - | |
701 | - /** | |
702 | - * @param reportVO | |
703 | - * @param userId | |
704 | - * @return | |
705 | - */ | |
706 | - private OrderFieldLockApplyDO buildReportFieldLockApplyDO(OrderCompletionReportVO reportVO, Long userId) { | |
707 | - OrderCompletionReportFieldVO reportFieldVO = report2reportField(reportVO); | |
708 | - return OrderFieldLockApplyDO.builder() | |
709 | - .applyUserId(userId) | |
710 | - .auditUserId(null) | |
711 | - .fields(JSONObject.toJSONString(reportFieldVO)) | |
712 | - .auditRoleCodes(RoleEnum.ADMIN.getCode()) | |
713 | - .orderId(reportFieldVO.getOrderId()) | |
714 | - .type(ApplyTypeEnum.ORDER_REPORT_APPLY.getType()) | |
715 | - .remark(ApplyTypeEnum.ORDER_REPORT_APPLY.getDesc()) | |
716 | - .status(ApplyStatusEnum.WAIT_AUDIT.getStatus()) | |
717 | - .build(); | |
718 | - } | |
719 | - | |
720 | - /** | |
721 | - * @param reportVO | |
722 | - * @return | |
723 | - */ | |
724 | - private OrderCompletionReportFieldVO report2reportField(OrderCompletionReportVO reportVO) { | |
725 | - return OrderCompletionReportFieldVO.builder() | |
726 | - .orderId(reportVO.getOrderId()) | |
727 | - .ideaSourceRate(Objects.nonNull(reportVO.getIdeaSourceRate()) ? reportVO.getIdeaSourceRate().toString() : null) | |
728 | - .ideaSource(StringUtils.isNotBlank(reportVO.getIdeaSource()) ? reportVO.getIdeaSource() : null) | |
729 | - .manualPreform1(StringUtils.isNotBlank(reportVO.getManualPreform1()) ? reportVO.getManualPreform1() : null) | |
730 | - .manualPreform1Rate(Objects.nonNull(reportVO.getManualPreform1Rate()) ? reportVO.getManualPreform1Rate().toString() : null) | |
731 | - .manualPreform2(StringUtils.isNotBlank(reportVO.getManualPreform2()) ? reportVO.getManualPreform2() : null) | |
732 | - .manualPreform2Rate(Objects.nonNull(reportVO.getManualPreform2Rate()) ? reportVO.getManualPreform2Rate().toString() : null) | |
733 | - .build(); | |
734 | - } | |
735 | - | |
736 | - | |
737 | - /** | |
738 | - * @param profitAnalysisFieldVO | |
739 | - * @param userId | |
740 | - * @return | |
741 | - */ | |
742 | - private OrderFieldLockApplyDO buildProfitFieldLockApplyDO(OrderProfitAnalysisFieldVO profitAnalysisFieldVO, Long userId) { | |
743 | - return OrderFieldLockApplyDO.builder() | |
744 | - .applyUserId(userId) | |
745 | - .auditUserId(null) | |
746 | - .fields(JSONObject.toJSONString(profitAnalysisFieldVO)) | |
747 | - .auditRoleCodes(RoleEnum.ADMIN.getCode()) | |
748 | - .orderId(profitAnalysisFieldVO.getOrderId()) | |
749 | - .type(ApplyTypeEnum.ORDER_PROFIT_APPLY.getType()) | |
750 | - .remark(ApplyTypeEnum.ORDER_PROFIT_APPLY.getDesc()) | |
751 | - .status(ApplyStatusEnum.WAIT_AUDIT.getStatus()) | |
752 | - .build(); | |
753 | - } | |
754 | - | |
755 | - /** | |
756 | - * @param profitAnalysisVO | |
757 | - * @return | |
758 | - */ | |
759 | - private OrderProfitAnalysisFieldVO profitAnalysis2profitAnalysisField(OrderBaseInfoDO orderBaseInfoDO, OrderProfitAnalysisVO profitAnalysisVO) { | |
760 | - if (Objects.nonNull(profitAnalysisVO.getCustomerPrice())) { | |
761 | - profitAnalysisVO.setCustomerTotalPrice(profitAnalysisVO.getCustomerPrice() * orderBaseInfoDO.getOrderCount()); | |
762 | - } | |
763 | - if (Objects.nonNull(profitAnalysisVO.getPacketPrice())) { | |
764 | - profitAnalysisVO.setPacketTotalPrice(profitAnalysisVO.getPacketPrice() * orderBaseInfoDO.getOrderCount()); | |
765 | - } | |
766 | - if (Objects.nonNull(profitAnalysisVO.getProductionDepartmentPrice())) { | |
767 | - profitAnalysisVO.setProductionDepartmentTotalPrice(profitAnalysisVO.getProductionDepartmentPrice() * orderBaseInfoDO.getOrderCount()); | |
768 | - } | |
769 | - Double profitRate = null; | |
770 | - if (Objects.nonNull(profitAnalysisVO.getCustomerTotalPrice()) | |
771 | - && Objects.nonNull(profitAnalysisVO.getExchangeRate()) | |
772 | - && Objects.nonNull(profitAnalysisVO.getPacketTotalPrice()) | |
773 | - && Objects.nonNull(profitAnalysisVO.getProductionDepartmentTotalPrice())) { | |
774 | - profitRate = ProfitUtils.calculateProfitRate(ProfitCalculateVO.builder() | |
775 | - .profitType(StringUtils.isBlank(profitAnalysisVO.getProfitType()) ? Constant.ZERO : Integer.parseInt(profitAnalysisVO.getProfitType())) | |
776 | - .customerTotalPrice(profitAnalysisVO.getCustomerTotalPrice()) | |
777 | - .exchangeRate(profitAnalysisVO.getExchangeRate()) | |
778 | - .packetTotalPrice(profitAnalysisVO.getPacketTotalPrice()) | |
779 | - .productionDepartmentTotalPrice(profitAnalysisVO.getProductionDepartmentTotalPrice()).build()); | |
780 | - } | |
781 | - return OrderProfitAnalysisFieldVO.builder() | |
782 | - .orderId(profitAnalysisVO.getOrderId()) | |
783 | - .profitType(StringUtils.isBlank(profitAnalysisVO.getProfitType()) ? Constant.STRING_ZERO : profitAnalysisVO.getProfitType()) | |
784 | - .customerRmbPrice(Objects.nonNull(profitAnalysisVO.getCustomerRmbPrice()) ? profitAnalysisVO.getCustomerRmbPrice().toString() : null) | |
785 | - .customerRmbTotalPrice(Objects.nonNull(profitAnalysisVO.getCustomerRmbTotalPrice()) ? profitAnalysisVO.getCustomerRmbTotalPrice().toString() : null) | |
786 | - .customerPrice(Objects.nonNull(profitAnalysisVO.getCustomerPrice()) ? profitAnalysisVO.getCustomerPrice().toString() : null) | |
787 | - .customerTotalPrice(Objects.nonNull(profitAnalysisVO.getCustomerTotalPrice()) ? profitAnalysisVO.getCustomerTotalPrice().toString() : null) | |
788 | - .customerCurrency(profitAnalysisVO.getCustomerCurrency()) | |
789 | - .packetPrice(Objects.nonNull(profitAnalysisVO.getPacketPrice()) ? profitAnalysisVO.getPacketPrice().toString() : null) | |
790 | - .packetTotalPrice(Objects.nonNull(profitAnalysisVO.getPacketTotalPrice()) ? profitAnalysisVO.getPacketTotalPrice().toString() : null) | |
791 | - .packetCurrency(profitAnalysisVO.getPacketCurrency()) | |
792 | - .productionDepartmentPrice(Objects.nonNull(profitAnalysisVO.getProductionDepartmentPrice()) ? profitAnalysisVO.getProductionDepartmentPrice().toString() : null) | |
793 | - .productionDepartmentTotalPrice(Objects.nonNull(profitAnalysisVO.getProductionDepartmentTotalPrice()) ? profitAnalysisVO.getProductionDepartmentTotalPrice().toString() : null) | |
794 | - .productionDepartmentCurrency(profitAnalysisVO.getProductionDepartmentCurrency()) | |
795 | - .exchangeRate(Objects.nonNull(profitAnalysisVO.getExchangeRate()) ? profitAnalysisVO.getExchangeRate().toString() : null) | |
796 | - .profitRate(Objects.nonNull(profitRate) ? profitRate.toString() : "0").build(); | |
797 | - } | |
798 | - | |
799 | - /** | |
800 | - * @param orderInfoResultVOList | |
801 | - */ | |
802 | - private void fillProfitAnalysisInfo(List<OrderInfoResultVO> orderInfoResultVOList) { | |
803 | - if (CollectionUtils.isEmpty(orderInfoResultVOList)) { | |
804 | - return; | |
805 | - } | |
806 | - | |
807 | - Set<Long> orderIds = orderInfoResultVOList.stream().map(OrderInfoResultVO::getId).collect(Collectors.toSet()); | |
808 | - List<OrderProfitAnalysisDO> orderProfitAnalysisDOS = profitAnalysisService.list(new LambdaQueryWrapper<OrderProfitAnalysisDO>() | |
809 | - .eq(BaseDO::getEnableFlag, Constant.ENABLE_TEN) | |
810 | - .in(OrderProfitAnalysisDO::getOrderId, orderIds)); | |
811 | - | |
812 | - if (CollectionUtils.isNotEmpty(orderProfitAnalysisDOS)) { | |
813 | - Map<Long, OrderProfitAnalysisDO> profitAnalysisDOMap = orderProfitAnalysisDOS.stream().collect(Collectors.toMap(OrderProfitAnalysisDO::getOrderId, Function.identity(), (v1, v2) -> v1)); | |
814 | - orderInfoResultVOList.forEach(result -> { | |
815 | - if (profitAnalysisDOMap.containsKey(result.getId())) { | |
816 | - OrderProfitAnalysisDO profitAnalysisDO = profitAnalysisDOMap.get(result.getId()); | |
817 | - OrderProfitAnalysisVO profitAnalysisVO = new OrderProfitAnalysisVO(); | |
818 | - BeanUtils.copyProperties(profitAnalysisDO, profitAnalysisVO); | |
819 | - profitAnalysisVO.setProfitType(String.valueOf(profitAnalysisDO.getProfitType())); | |
820 | - result.setProfitAnalysisInfo(profitAnalysisVO); | |
821 | - } | |
822 | - }); | |
823 | - } | |
824 | - | |
825 | - } | |
826 | - | |
827 | - /** | |
828 | - * @param orderInfoResultVOList | |
829 | - */ | |
830 | - private void fillReportInfo(List<OrderInfoResultVO> orderInfoResultVOList) { | |
831 | - if (CollectionUtils.isEmpty(orderInfoResultVOList)) { | |
832 | - return; | |
833 | - } | |
834 | - | |
835 | - Set<Long> orderIds = orderInfoResultVOList.stream().map(OrderInfoResultVO::getId).collect(Collectors.toSet()); | |
836 | - List<OrderCompletionReportDO> orderCompletionReportDOS = reportService.list(new LambdaQueryWrapper<OrderCompletionReportDO>() | |
837 | - .eq(BaseDO::getEnableFlag, Constant.ENABLE_TEN) | |
838 | - .in(OrderCompletionReportDO::getOrderId, orderIds)); | |
839 | - if (CollectionUtils.isEmpty(orderCompletionReportDOS)) { | |
840 | - return; | |
841 | - } | |
842 | - Map<Long, OrderCompletionReportDO> completionReportDOMap = orderCompletionReportDOS.stream().collect(Collectors.toMap(OrderCompletionReportDO::getOrderId, Function.identity(), (v1, v2) -> v1)); | |
843 | - orderInfoResultVOList.forEach(result -> { | |
844 | - if (completionReportDOMap.containsKey(result.getId())) { | |
845 | - OrderCompletionReportDO completionReportDO = completionReportDOMap.get(result.getId()); | |
846 | - OrderCompletionReportVO completionReportVO = new OrderCompletionReportVO(); | |
847 | - BeanUtils.copyProperties(completionReportDO, completionReportVO); | |
848 | - result.setReportInfo(completionReportVO); | |
849 | - } | |
850 | - }); | |
851 | - } | |
852 | - | |
853 | - /** | |
854 | - * @param orderInfoResultVOList | |
855 | - */ | |
856 | - private void fillTrackStageInfo(List<OrderInfoResultVO> orderInfoResultVOList) { | |
857 | - if (CollectionUtils.isEmpty(orderInfoResultVOList)) { | |
858 | - return; | |
859 | - } | |
860 | - | |
861 | - Set<Long> orderIds = orderInfoResultVOList.stream().map(OrderInfoResultVO::getId).collect(Collectors.toSet()); | |
862 | - List<OrderTrackStageDO> trackStageDOS = trackStageService.list(new LambdaQueryWrapper<OrderTrackStageDO>() | |
863 | - .eq(BaseDO::getEnableFlag, Constant.ENABLE_TEN) | |
864 | - .in(OrderTrackStageDO::getOrderId, orderIds)); | |
865 | - if (CollectionUtils.isEmpty(trackStageDOS)) { | |
866 | - return; | |
867 | - } | |
868 | - Map<Long, OrderTrackStageDO> trackStageDOMap = trackStageDOS.stream().collect(Collectors.toMap(OrderTrackStageDO::getOrderId, Function.identity())); | |
869 | - orderInfoResultVOList.forEach(result -> { | |
870 | - if (trackStageDOMap.containsKey(result.getId())) { | |
871 | - OrderTrackStageDO trackStageDO = trackStageDOMap.get(result.getId()); | |
872 | - OrderTrackStageVO trackStageVO = new OrderTrackStageVO(); | |
873 | - BeanUtils.copyProperties(trackStageDO, trackStageVO); | |
874 | - result.setTrackStageInfo(trackStageVO); | |
875 | - } | |
876 | - }); | |
877 | - } | |
878 | - | |
879 | - /** | |
880 | - * @param orderInfoResultVOList | |
881 | - */ | |
882 | - private void fillSchedules(List<OrderInfoResultVO> orderInfoResultVOList) { | |
883 | - if (CollectionUtils.isEmpty(orderInfoResultVOList)) { | |
884 | - return; | |
885 | - } | |
886 | - | |
887 | - orderInfoResultVOList.forEach(x -> { | |
888 | - int i = 0; | |
889 | - if (isFillOrderBaseInfo(x)) { | |
890 | - i++; | |
891 | - } | |
892 | - if (isFillProfitInfo(x.getProfitAnalysisInfo())) { | |
893 | - i++; | |
894 | - } | |
895 | - if (isFillReportInfo(x.getReportInfo())) { | |
896 | - i++; | |
897 | - } | |
898 | - if (isFillTrackInfo(x.getTrackStageInfo())) { | |
899 | - i++; | |
900 | - } | |
901 | - if (isFillInspectionInfo(x.getInspectionStageInfo())) { | |
902 | - i++; | |
903 | - } | |
904 | - x.setSchedule(new BigDecimal(i).divide(new BigDecimal(Constant.FOUR)).doubleValue()); | |
905 | - }); | |
906 | - } | |
907 | - | |
908 | - /** | |
909 | - * @param inspectionStageInfo | |
910 | - * @return | |
911 | - */ | |
912 | - private boolean isFillInspectionInfo(OrderInspectionStageVO inspectionStageInfo) { | |
913 | - if (Objects.isNull(inspectionStageInfo)) { | |
914 | - return false; | |
915 | - } | |
916 | - if (StringUtils.isBlank(inspectionStageInfo.getMidCheckApplyTime())) { | |
917 | - return false; | |
918 | - } | |
919 | - if (StringUtils.isBlank(inspectionStageInfo.getMidCheckComment())) { | |
920 | - return false; | |
921 | - } | |
922 | - if (StringUtils.isBlank(inspectionStageInfo.getMidCheckResult())) { | |
923 | - return false; | |
924 | - } | |
925 | - if (StringUtils.isBlank(inspectionStageInfo.getEndCheckApplyTime())) { | |
926 | - return false; | |
927 | - } | |
928 | - if (StringUtils.isBlank(inspectionStageInfo.getSpecification())) { | |
929 | - return false; | |
930 | - } | |
931 | - if (StringUtils.isBlank(inspectionStageInfo.getFunctionality())) { | |
932 | - return false; | |
933 | - } | |
934 | - if (StringUtils.isBlank(inspectionStageInfo.getElectroplate())) { | |
935 | - return false; | |
936 | - } | |
937 | - if (StringUtils.isBlank(inspectionStageInfo.getBoxPacket())) { | |
938 | - return false; | |
939 | - } | |
940 | - if (StringUtils.isBlank(inspectionStageInfo.getEndCheckResult())) { | |
941 | - return false; | |
942 | - } else if ("FAIL".equals(inspectionStageInfo.getEndCheckResult())) { | |
943 | - return false; | |
944 | - } | |
945 | - return true; | |
946 | - } | |
947 | - | |
948 | - /** | |
949 | - * @param trackStageVO | |
950 | - * @return | |
951 | - */ | |
952 | - private boolean isFillTrackInfo(OrderTrackStageVO trackStageVO) { | |
953 | - if (Objects.isNull(trackStageVO)) { | |
954 | - return false; | |
955 | - } | |
956 | - if (StringUtils.isBlank(trackStageVO.getPpTime())) { | |
957 | - return false; | |
958 | - } | |
959 | - if (StringUtils.isBlank(trackStageVO.getPpConfirmResult())) { | |
960 | - return false; | |
961 | - } | |
962 | - if (StringUtils.isBlank(trackStageVO.getEsoSampleSendTime())) { | |
963 | - return false; | |
964 | - } | |
965 | - if (StringUtils.isBlank(trackStageVO.getShippmentSampleSendTime())) { | |
966 | - return false; | |
967 | - } | |
968 | - if (StringUtils.isBlank(trackStageVO.getShippmentSampleConfirmResult())) { | |
969 | - return false; | |
970 | - } | |
971 | - if (StringUtils.isBlank(trackStageVO.getSelfTestPassTime())) { | |
972 | - return false; | |
973 | - } | |
974 | - if (StringUtils.isBlank(trackStageVO.getAitexTestSendTime())) { | |
975 | - return false; | |
976 | - } | |
977 | - if (StringUtils.isBlank(trackStageVO.getAitexTestFinishResult())) { | |
978 | - return false; | |
979 | - } | |
980 | - if (StringUtils.isBlank(trackStageVO.getSgsTestSendTime())) { | |
981 | - return false; | |
982 | - } | |
983 | - if (StringUtils.isBlank(trackStageVO.getSgsTestFinishResult())) { | |
984 | - return false; | |
985 | - } | |
986 | - if (StringUtils.isBlank(trackStageVO.getBarcodeStickerArrivalTime())) { | |
987 | - return false; | |
988 | - } | |
989 | - if (StringUtils.isBlank(trackStageVO.getLatestArrivalTime())) { | |
990 | - return false; | |
991 | - } | |
992 | - if (StringUtils.isBlank(trackStageVO.getLatestBkTime())) { | |
993 | - return false; | |
994 | - } | |
995 | - return true; | |
996 | - } | |
997 | - | |
998 | - | |
999 | - /** | |
1000 | - * @param reportInfo | |
1001 | - * @return | |
1002 | - */ | |
1003 | - private boolean isFillReportInfo(OrderCompletionReportVO reportInfo) { | |
1004 | - if (Objects.isNull(reportInfo)) { | |
1005 | - return false; | |
1006 | - } | |
1007 | - if (StringUtils.isBlank(reportInfo.getIdeaSource())) { | |
1008 | - return false; | |
1009 | - } | |
1010 | - if (Objects.isNull(reportInfo.getIdeaSourceRate())) { | |
1011 | - return false; | |
1012 | - } | |
1013 | - if (StringUtils.isBlank(reportInfo.getManualPreform1())) { | |
1014 | - return false; | |
1015 | - } | |
1016 | - if (Objects.isNull(reportInfo.getManualPreform1Rate())) { | |
1017 | - return false; | |
1018 | - } | |
1019 | - if (StringUtils.isBlank(reportInfo.getManualPreform2())) { | |
1020 | - return false; | |
1021 | - } | |
1022 | - if (Objects.isNull(reportInfo.getManualPreform2Rate())) { | |
1023 | - return false; | |
1024 | - } | |
1025 | - return true; | |
1026 | - } | |
1027 | - | |
1028 | - /** | |
1029 | - * @param profitAnalysisInfo | |
1030 | - * @return | |
1031 | - */ | |
1032 | - private boolean isFillProfitInfo(OrderProfitAnalysisVO profitAnalysisInfo) { | |
1033 | - if (Objects.isNull(profitAnalysisInfo)) { | |
1034 | - return false; | |
1035 | - } | |
1036 | - if (Objects.isNull(profitAnalysisInfo.getCustomerPrice())) { | |
1037 | - return false; | |
1038 | - } | |
1039 | - if (Objects.isNull(profitAnalysisInfo.getCustomerTotalPrice())) { | |
1040 | - return false; | |
1041 | - } | |
1042 | - if (Objects.isNull(profitAnalysisInfo.getProductionDepartmentPrice())) { | |
1043 | - return false; | |
1044 | - } | |
1045 | - if (Objects.isNull(profitAnalysisInfo.getProductionDepartmentTotalPrice())) { | |
1046 | - return false; | |
1047 | - } | |
1048 | - if (Objects.isNull(profitAnalysisInfo.getPacketPrice())) { | |
1049 | - return false; | |
1050 | - } | |
1051 | - if (Objects.isNull(profitAnalysisInfo.getPacketTotalPrice())) { | |
1052 | - return false; | |
1053 | - } | |
1054 | - if (Objects.isNull(profitAnalysisInfo.getExchangeRate())) { | |
1055 | - return false; | |
1056 | - } | |
1057 | - return true; | |
1058 | - } | |
1059 | - | |
1060 | - /** | |
1061 | - * @param resultVO | |
1062 | - * @return | |
1063 | - */ | |
1064 | - private boolean isFillOrderBaseInfo(OrderInfoResultVO resultVO) { | |
1065 | - if (Objects.isNull(resultVO)) { | |
1066 | - return false; | |
1067 | - } | |
1068 | - if (StringUtils.isBlank(resultVO.getCustomerCode())) { | |
1069 | - return false; | |
1070 | - } | |
1071 | - if (StringUtils.isBlank(resultVO.getProjectNo())) { | |
1072 | - return false; | |
1073 | - } | |
1074 | - if (StringUtils.isBlank(resultVO.getProductionDepartment())) { | |
1075 | - return false; | |
1076 | - } | |
1077 | - if (StringUtils.isBlank(resultVO.getInnerNo())) { | |
1078 | - return false; | |
1079 | - } | |
1080 | - if (StringUtils.isBlank(resultVO.getCustomerPo())) { | |
1081 | - return false; | |
1082 | - } | |
1083 | - if (StringUtils.isBlank(resultVO.getCustomerStyle())) { | |
1084 | - return false; | |
1085 | - } | |
1086 | - if (StringUtils.isBlank(resultVO.getModeleLo())) { | |
1087 | - return false; | |
1088 | - } | |
1089 | - if (StringUtils.isBlank(resultVO.getCollection())) { | |
1090 | - return false; | |
1091 | - } | |
1092 | - if (StringUtils.isBlank(resultVO.getPoColor())) { | |
1093 | - return false; | |
1094 | - } | |
1095 | - if (StringUtils.isBlank(resultVO.getCnColor())) { | |
1096 | - return false; | |
1097 | - } | |
1098 | - if (StringUtils.isBlank(resultVO.getPicUrl())) { | |
1099 | - return false; | |
1100 | - } | |
1101 | - if (StringUtils.isBlank(resultVO.getProductionComment())) { | |
1102 | - return false; | |
1103 | - } | |
1104 | - if (Objects.isNull(resultVO.getOrderCount())) { | |
1105 | - return false; | |
1106 | - } | |
1107 | - if (StringUtils.isBlank(resultVO.getOrderComposition())) { | |
1108 | - return false; | |
1109 | - } | |
1110 | - if (StringUtils.isBlank(resultVO.getProductStyle())) { | |
1111 | - return false; | |
1112 | - } | |
1113 | - if (StringUtils.isBlank(resultVO.getProductionDepartmentConsignTime())) { | |
1114 | - return false; | |
1115 | - } | |
1116 | - if (StringUtils.isBlank(resultVO.getOrderHodTime())) { | |
1117 | - return false; | |
1118 | - } | |
1119 | - if (StringUtils.isBlank(resultVO.getOutboundType())) { | |
1120 | - return false; | |
1121 | - } | |
1122 | - if (StringUtils.isBlank(resultVO.getPacketType())) { | |
1123 | - return false; | |
1124 | - } | |
1125 | - return true; | |
1126 | - } | |
1127 | - | |
1128 | - /** | |
1129 | - * @param orderInfoResultVOList | |
1130 | - */ | |
1131 | - private void fillOrderUpdateInfos(List<OrderInfoResultVO> orderInfoResultVOList) { | |
1132 | - if (CollectionUtils.isEmpty(orderInfoResultVOList)) { | |
1133 | - return; | |
1134 | - } | |
1135 | - | |
1136 | - Set<Long> orderIds = orderInfoResultVOList.stream().map(OrderInfoResultVO::getId).collect(Collectors.toSet()); | |
1137 | - | |
1138 | - List<OrderFieldLockApplyDO> fieldLockApplyDOList = orderFieldLockApplyService.list(new LambdaQueryWrapper<OrderFieldLockApplyDO>() | |
1139 | - .eq(BaseDO::getEnableFlag, Constant.ENABLE_TEN) | |
1140 | - .eq(OrderFieldLockApplyDO::getApplyUserId, dataScope.getLoginUserId()) | |
1141 | - .in(OrderFieldLockApplyDO::getStatus, new int[]{ApplyStatusEnum.WAIT_AUDIT.getStatus(), ApplyStatusEnum.AUDIT_REFUSE.getStatus()}) | |
1142 | - .in(OrderFieldLockApplyDO::getOrderId, orderIds).orderByAsc(OrderFieldLockApplyDO::getId)); | |
1143 | - | |
1144 | - if (CollectionUtils.isNotEmpty(fieldLockApplyDOList)) { | |
1145 | - Map<Long, OrderFieldLockApplyDO> applyDOMap = fieldLockApplyDOList.stream().collect(Collectors.toMap(OrderFieldLockApplyDO::getOrderId, Function.identity(), (v1, v2) -> v1)); | |
1146 | - orderInfoResultVOList.forEach(x -> { | |
1147 | - OrderFieldLockApplyDO applyDO = applyDOMap.get(x.getId()); | |
1148 | - if (Objects.nonNull(applyDO) && ApplyTypeEnum.ORDER_REPORT_APPLY.getType().equals(applyDO.getType())) { | |
1149 | - String fields = applyDO.getFields(); | |
1150 | - if (StringUtils.isNotBlank(fields)) { | |
1151 | - OrderUpdateInfoVO fieldVO = OrderUpdateInfoVO.builder().reportFields(JSONObject.parseObject(fields, OrderCompletionReportFieldVO.class)).build(); | |
1152 | - x.setOrderUpdateInfoVO(fieldVO); | |
1153 | - } | |
1154 | - } | |
1155 | - if (Objects.nonNull(applyDO) && ApplyTypeEnum.ORDER_PROFIT_APPLY.getType().equals(applyDO.getType())) { | |
1156 | - String fields = applyDO.getFields(); | |
1157 | - if (StringUtils.isNotBlank(fields)) { | |
1158 | - OrderUpdateInfoVO fieldVO = OrderUpdateInfoVO.builder().profitAnalysisFields(JSONObject.parseObject(fields, OrderProfitAnalysisFieldVO.class)).build(); | |
1159 | - x.setOrderUpdateInfoVO(fieldVO); | |
1160 | - } | |
1161 | - } | |
1162 | - }); | |
1163 | - } | |
1164 | - } | |
1165 | - | |
1166 | - /** | |
1167 | - * @param orderInfoResultVOList | |
1168 | - */ | |
1169 | - private void fillLockFields(List<OrderInfoResultVO> orderInfoResultVOList) { | |
1170 | - if (CollectionUtils.isEmpty(orderInfoResultVOList)) { | |
1171 | - return; | |
1172 | - } | |
1173 | - | |
1174 | - Set<Long> orderIds = orderInfoResultVOList.stream().map(OrderInfoResultVO::getId).collect(Collectors.toSet()); | |
1175 | - | |
1176 | - List<OrderFieldLockRecordDO> fieldLockRecordDOList = fieldLockRecordService.list(new LambdaQueryWrapper<OrderFieldLockRecordDO>() | |
1177 | - .eq(BaseDO::getEnableFlag, Constant.ENABLE_TEN) | |
1178 | - .eq(OrderFieldLockRecordDO::getUserId, dataScope.getLoginUserId()) | |
1179 | - .in(OrderFieldLockRecordDO::getOrderId, orderIds) | |
1180 | - .orderByAsc(OrderFieldLockRecordDO::getId)); | |
1181 | - | |
1182 | - if (CollectionUtils.isNotEmpty(fieldLockRecordDOList)) { | |
1183 | - Map<Long, OrderFieldLockRecordDO> recordDOMap = fieldLockRecordDOList.stream().collect(Collectors.toMap(OrderFieldLockRecordDO::getOrderId, Function.identity(), (v1, v2) -> v1)); | |
1184 | - orderInfoResultVOList.forEach(x -> { | |
1185 | - OrderFieldLockRecordDO recordDO = recordDOMap.get(x.getId()); | |
1186 | - if (Objects.nonNull(recordDO)) { | |
1187 | - String fields = recordDO.getFields(); | |
1188 | - if (StringUtils.isNotBlank(fields)) { | |
1189 | - OrderLockFieldVO fieldVO = JSONObject.parseObject(fields, OrderLockFieldVO.class); | |
1190 | - x.setLockFields(fieldVO); | |
1191 | - } else { | |
1192 | - x.setLockFields(OrderFieldUtils.initField(OrderLockFieldEnum.LOCKED)); | |
1193 | - } | |
1194 | - } else { | |
1195 | - x.setLockFields(OrderFieldUtils.initField(OrderLockFieldEnum.LOCKED)); | |
1196 | - } | |
1197 | - }); | |
1198 | - } else { | |
1199 | - orderInfoResultVOList.forEach(x -> { | |
1200 | - x.setLockFields(OrderFieldUtils.initField(OrderLockFieldEnum.LOCKED)); | |
1201 | - }); | |
1202 | - } | |
1203 | - | |
1204 | - } | |
1205 | - | |
1206 | - /** | |
1207 | - * @param orderInfoResultVOList | |
1208 | - */ | |
1209 | - private void fillInspectionStageInfo(List<OrderInfoResultVO> orderInfoResultVOList) { | |
1210 | - if (CollectionUtils.isEmpty(orderInfoResultVOList)) { | |
1211 | - return; | |
1212 | - } | |
1213 | - | |
1214 | - Set<Long> orderIds = orderInfoResultVOList.stream().map(OrderInfoResultVO::getId).collect(Collectors.toSet()); | |
1215 | - List<OrderInspectionStageDO> inspectionStageDOS = inspectionStageService.list(new LambdaQueryWrapper<OrderInspectionStageDO>() | |
1216 | - .eq(BaseDO::getEnableFlag, Constant.ENABLE_TEN) | |
1217 | - .in(OrderInspectionStageDO::getOrderId, orderIds)); | |
1218 | - if (CollectionUtils.isEmpty(inspectionStageDOS)) { | |
1219 | - return; | |
1220 | - } | |
1221 | - Map<Long, OrderInspectionStageDO> inspectionStageDOMap = inspectionStageDOS.stream().collect(Collectors.toMap(OrderInspectionStageDO::getOrderId, Function.identity())); | |
1222 | - orderInfoResultVOList.forEach(result -> { | |
1223 | - if (inspectionStageDOMap.containsKey(result.getId())) { | |
1224 | - OrderInspectionStageDO inspectionStageDO = inspectionStageDOMap.get(result.getId()); | |
1225 | - OrderInspectionStageVO inspectionStageVO = new OrderInspectionStageVO(); | |
1226 | - BeanUtils.copyProperties(inspectionStageDO, inspectionStageVO); | |
1227 | - result.setInspectionStageInfo(inspectionStageVO); | |
1228 | - } | |
1229 | - }); | |
1230 | - } | |
1231 | - | |
1232 | - /** | |
1233 | - * @param queryVO | |
1234 | - * @return | |
1235 | - */ | |
1236 | - @Override | |
1237 | - public LambdaQueryWrapper<OrderBaseInfoDO> buildQueryByParam(OrderBaseInfoQueryVO queryVO) { | |
1238 | - RoleEnum roleEnum = dataScope.getRole(); | |
1239 | - // 跟单员 | |
1240 | - if (Objects.nonNull(roleEnum) && roleEnum.getId().equals(RoleEnum.TRACKER_USER.getId())) { | |
1241 | - queryVO.setCreateBy(dataScope.getLoginUserName()); | |
1242 | - } | |
1243 | - // 业务员 | |
1244 | - if (Objects.nonNull(roleEnum) && roleEnum.getId().equals(RoleEnum.BUSINESS_USER.getId())) { | |
1245 | - queryVO.setBusinessPerson(Arrays.asList(dataScope.getUser().getNickName())); | |
1246 | - } | |
1247 | - if (StringUtils.isNotBlank(queryVO.getCommitUserPhone())) { | |
1248 | - AdminUserDO userDO = userService.getOne(new LambdaQueryWrapper<AdminUserDO>() | |
1249 | - .eq(BaseDO::getEnableFlag, Constant.ENABLE_TEN) | |
1250 | - .eq(AdminUserDO::getPhone, queryVO.getCommitUserPhone()).last("limit 1")); | |
1251 | - queryVO.setCommitUserName(userDO.getUserName()); | |
1252 | - } | |
1253 | - Set<Long> orderIds = new HashSet<>(); | |
1254 | - if (Objects.nonNull(queryVO.getProfitRateGqt()) || Objects.nonNull(queryVO.getProfitRateLqt())) { | |
1255 | - List<OrderProfitAnalysisDO> profitAnalysisDOS = profitAnalysisService.list(new LambdaQueryWrapper<OrderProfitAnalysisDO>() | |
1256 | - .eq(BaseDO::getEnableFlag, Constant.ENABLE_TEN) | |
1257 | - .ge(Objects.nonNull(queryVO.getProfitRateLqt()), OrderProfitAnalysisDO::getProfitRate, queryVO.getProfitRateLqt()) | |
1258 | - .le(Objects.nonNull(queryVO.getProfitRateGqt()), OrderProfitAnalysisDO::getProfitRate, queryVO.getProfitRateGqt())); | |
1259 | - if (CollectionUtils.isNotEmpty(profitAnalysisDOS)) { | |
1260 | - orderIds.addAll(profitAnalysisDOS.stream().map(OrderProfitAnalysisDO::getOrderId).collect(Collectors.toSet())); | |
1261 | - } else { | |
1262 | - orderIds.add(-1L); | |
1263 | - } | |
1264 | - } | |
1265 | - | |
1266 | - if (StringUtils.isNotBlank(queryVO.getDesigner())) { | |
1267 | - List<OrderCompletionReportDO> reportDOS = reportService.list(new LambdaQueryWrapper<OrderCompletionReportDO>() | |
1268 | - .eq(BaseDO::getEnableFlag, Constant.ENABLE_TEN) | |
1269 | - .and(q -> q.eq(OrderCompletionReportDO::getIdeaSource, queryVO.getDesigner()).or() | |
1270 | - .eq(OrderCompletionReportDO::getManualPreform1, queryVO.getDesigner()).or() | |
1271 | - .eq(OrderCompletionReportDO::getManualPreform2, queryVO.getDesigner()))); | |
1272 | - if (CollectionUtils.isNotEmpty(reportDOS)) { | |
1273 | - Set<Long> reportOrderIds = reportDOS.stream().map(OrderCompletionReportDO::getOrderId).collect(Collectors.toSet()); | |
1274 | - if (CollectionUtils.isNotEmpty(orderIds)) { | |
1275 | - Collection<Long> set = CollectionUtil.intersection(orderIds, reportOrderIds); | |
1276 | - if (CollectionUtils.isEmpty(set)) { | |
1277 | - orderIds.add(-1L); | |
1278 | - } else { | |
1279 | - orderIds.addAll(set); | |
1280 | - } | |
1281 | - } else { | |
1282 | - orderIds.addAll(reportOrderIds); | |
1283 | - } | |
1284 | - } else { | |
1285 | - orderIds.add(-1L); | |
1286 | - } | |
1287 | - } else if (CollectionUtils.isNotEmpty(queryVO.getIdeaSource()) || CollectionUtils.isNotEmpty(queryVO.getManualPreform1()) || CollectionUtils.isNotEmpty(queryVO.getManualPreform2())) { | |
1288 | - List<OrderCompletionReportDO> reportDOS = reportService.list(new LambdaQueryWrapper<OrderCompletionReportDO>() | |
1289 | - .eq(BaseDO::getEnableFlag, Constant.ENABLE_TEN) | |
1290 | - .in(CollectionUtils.isNotEmpty(queryVO.getIdeaSource()), OrderCompletionReportDO::getIdeaSource, queryVO.getIdeaSource()) | |
1291 | - .in(CollectionUtils.isNotEmpty(queryVO.getManualPreform2()), OrderCompletionReportDO::getManualPreform2, queryVO.getManualPreform2()) | |
1292 | - .in(CollectionUtils.isNotEmpty(queryVO.getManualPreform1()), OrderCompletionReportDO::getManualPreform1, queryVO.getManualPreform1())); | |
1293 | - if (CollectionUtils.isNotEmpty(reportDOS)) { | |
1294 | - Set<Long> reportOrderIds = reportDOS.stream().map(OrderCompletionReportDO::getOrderId).collect(Collectors.toSet()); | |
1295 | - if (CollectionUtils.isNotEmpty(orderIds)) { | |
1296 | - Collection<Long> set = CollectionUtil.intersection(orderIds, reportOrderIds); | |
1297 | - if (CollectionUtils.isEmpty(set)) { | |
1298 | - orderIds.add(-1L); | |
1299 | - } else { | |
1300 | - orderIds.addAll(set); | |
1301 | - } | |
1302 | - } else { | |
1303 | - orderIds.addAll(reportOrderIds); | |
1304 | - } | |
1305 | - } else { | |
1306 | - orderIds.add(-1L); | |
1307 | - } | |
1308 | - } | |
1309 | - | |
1310 | - if (CollectionUtils.isNotEmpty(queryVO.getPpConfirmResult()) || StringUtils.isNotBlank(queryVO.getSelfTestPassStartTime()) || StringUtils.isNotBlank(queryVO.getSelfTestPassEndTime())) { | |
1311 | - List<OrderTrackStageDO> trackStageDOS = trackStageService.list(new LambdaQueryWrapper<OrderTrackStageDO>() | |
1312 | - .eq(BaseDO::getEnableFlag, Constant.ENABLE_TEN) | |
1313 | - .in(CollectionUtils.isNotEmpty(queryVO.getPpConfirmResult()), OrderTrackStageDO::getPpConfirmResult, queryVO.getPpConfirmResult()) | |
1314 | - .ge(StringUtils.isNotBlank(queryVO.getSelfTestPassStartTime()), OrderTrackStageDO::getSelfTestPassTime, queryVO.getSelfTestPassStartTime()) | |
1315 | - .le(StringUtils.isNotBlank(queryVO.getSelfTestPassEndTime()), OrderTrackStageDO::getSelfTestPassTime, queryVO.getSelfTestPassEndTime()) | |
1316 | - ); | |
1317 | - if (CollectionUtils.isNotEmpty(trackStageDOS)) { | |
1318 | - Set<Long> trackOrderIds = trackStageDOS.stream().map(OrderTrackStageDO::getOrderId).collect(Collectors.toSet()); | |
1319 | - if (CollectionUtils.isNotEmpty(orderIds)) { | |
1320 | - Collection<Long> set = CollectionUtil.intersection(orderIds, trackOrderIds); | |
1321 | - if (CollectionUtils.isEmpty(set)) { | |
1322 | - orderIds.add(-1L); | |
1323 | - } else { | |
1324 | - orderIds.addAll(set); | |
1325 | - } | |
1326 | - } else { | |
1327 | - orderIds.addAll(trackOrderIds); | |
1328 | - } | |
1329 | - } else { | |
1330 | - orderIds.add(-1L); | |
1331 | - } | |
1332 | - } | |
1333 | - | |
1334 | - if (CollectionUtils.isNotEmpty(queryVO.getMidCheckResult()) || CollectionUtils.isNotEmpty(queryVO.getEndCheckResult())) { | |
1335 | - List<OrderInspectionStageDO> inspectionStageDOS = inspectionStageService.list(new LambdaQueryWrapper<OrderInspectionStageDO>() | |
1336 | - .eq(BaseDO::getEnableFlag, Constant.ENABLE_TEN) | |
1337 | - .in(CollectionUtils.isNotEmpty(queryVO.getMidCheckResult()), OrderInspectionStageDO::getMidCheckResult, queryVO.getMidCheckResult()) | |
1338 | - .in(CollectionUtils.isNotEmpty(queryVO.getEndCheckResult()), OrderInspectionStageDO::getEndCheckResult, queryVO.getEndCheckResult()) | |
1339 | - ); | |
1340 | - if (CollectionUtils.isNotEmpty(inspectionStageDOS)) { | |
1341 | - Set<Long> inspectOrderIds = inspectionStageDOS.stream().map(OrderInspectionStageDO::getOrderId).collect(Collectors.toSet()); | |
1342 | - if (CollectionUtils.isNotEmpty(orderIds)) { | |
1343 | - Collection<Long> set = CollectionUtil.intersection(orderIds, inspectOrderIds); | |
1344 | - if (CollectionUtils.isEmpty(set)) { | |
1345 | - orderIds.add(-1L); | |
1346 | - } else { | |
1347 | - orderIds.addAll(set); | |
1348 | - } | |
1349 | - } else { | |
1350 | - orderIds.addAll(inspectOrderIds); | |
1351 | - } | |
1352 | - } else { | |
1353 | - orderIds.add(-1L); | |
1354 | - } | |
1355 | - } | |
1356 | - | |
1357 | - //wmr:修改代码,导出指定的订单,2023.12.28 | |
1358 | -// if (queryVO.getFieldVO()!=null&&!CollectionUtils.isEmpty(queryVO.getFieldVO().getOrderIds())) { | |
1359 | -// if (CollectionUtils.isNotEmpty(orderIds)) { | |
1360 | -// Set<Long> collect = queryVO.getFieldVO().getOrderIds().stream() | |
1361 | -// .filter(orderIds::contains) | |
1362 | -// .collect(Collectors.toSet()); | |
1363 | -// queryVO.setOrderIds(collect); | |
1364 | -// } | |
1365 | -// } else { | |
1366 | -// if (CollectionUtils.isNotEmpty(orderIds)) { | |
1367 | -// queryVO.setOrderIds(orderIds); | |
1368 | -// } | |
1369 | -// } | |
1370 | - | |
1371 | -// if (queryVO.getFieldVO() != null && queryVO.getFieldVO().getOrderIds() != null) { | |
1372 | -// Set<Long> collect = new HashSet<>(queryVO.getFieldVO().getOrderIds()); | |
1373 | -// if (collect.size() > 0) { | |
1374 | -// queryVO.setOrderIds(collect); | |
1375 | -// } | |
1376 | -// } | |
1377 | - | |
1378 | - return new LambdaQueryWrapper<OrderBaseInfoDO>() | |
1379 | - .eq(BaseDO::getEnableFlag, Constant.ENABLE_TEN) | |
1380 | - .in(CollectionUtils.isNotEmpty(queryVO.getCustomerCode()), OrderBaseInfoDO::getCustomerCode, queryVO.getCustomerCode()) | |
1381 | - .eq(StringUtils.isNotBlank(queryVO.getCommitUserName()), OrderBaseInfoDO::getCreateBy, queryVO.getCommitUserName()) | |
1382 | - .ge(StringUtils.isNotBlank(queryVO.getCreateStartTime()), OrderBaseInfoDO::getCreateTime, queryVO.getCreateStartTime()) | |
1383 | - .le(StringUtils.isNotBlank(queryVO.getCreateEndTime()), OrderBaseInfoDO::getCreateTime, queryVO.getCreateEndTime()) | |
1384 | - .in(CollectionUtils.isNotEmpty(queryVO.getOrderStatus()), OrderBaseInfoDO::getOrderStatus, queryVO.getOrderStatus()) | |
1385 | - .in(CollectionUtils.isNotEmpty(queryVO.getProjectNo()), OrderBaseInfoDO::getProjectNo, queryVO.getProjectNo()) | |
1386 | - .in(CollectionUtils.isNotEmpty(queryVO.getInnerNo()), OrderBaseInfoDO::getInnerNo, queryVO.getInnerNo()) | |
1387 | - .in(CollectionUtils.isNotEmpty(queryVO.getProductionDepartment()), OrderBaseInfoDO::getProductionDepartment, queryVO.getProductionDepartment()) | |
1388 | - .eq(StringUtils.isNotBlank(queryVO.getCreateBy()), OrderBaseInfoDO::getCreateBy, queryVO.getCreateBy()) | |
1389 | - .in(CollectionUtils.isNotEmpty(queryVO.getBusinessPerson()), OrderBaseInfoDO::getBusinessPerson, queryVO.getBusinessPerson()) | |
1390 | - .ge(StringUtils.isNotBlank(queryVO.getProductionDepartmentConsignStartTime()), OrderBaseInfoDO::getProductionDepartmentConsignTime, queryVO.getProductionDepartmentConsignStartTime()) | |
1391 | - .le(StringUtils.isNotBlank(queryVO.getProductionDepartmentConsignEndTime()), OrderBaseInfoDO::getProductionDepartmentConsignTime, queryVO.getProductionDepartmentConsignEndTime()) | |
1392 | - .ge(StringUtils.isNotBlank(queryVO.getOrderHodStartTime()), OrderBaseInfoDO::getOrderHodTime, queryVO.getOrderHodStartTime()) | |
1393 | - .le(StringUtils.isNotBlank(queryVO.getOrderHodEndTime()), OrderBaseInfoDO::getOrderHodTime, queryVO.getOrderHodEndTime()) | |
1394 | - .in(CollectionUtils.isNotEmpty(queryVO.getOrderIds()), OrderBaseInfoDO::getId, queryVO.getOrderIds()) | |
1395 | - .orderByDesc(OrderBaseInfoDO::getId) | |
1396 | - ; | |
1397 | - } | |
1398 | - | |
1399 | - | |
1400 | - /** | |
1401 | - * 新增数据 | |
1402 | - * | |
1403 | - * @param orderAddVO 实例对象 | |
1404 | - * @return 实例对象 | |
1405 | - */ | |
1406 | - @Override | |
1407 | - @Transactional(rollbackFor = Exception.class) | |
1408 | - public ServerResult add(OrderAddVO orderAddVO) { | |
1409 | - OrderBaseInfoVO baseInfoVO = orderAddVO.getBaseInfo(); | |
1410 | - if (Objects.isNull(baseInfoVO)) { | |
1411 | - throw new BusinessException(ServerResultCode.ORDER_BASE_INFO_EMPTY); | |
1412 | - } | |
1413 | - Long userId = dataScope.getLoginUserId(); | |
1414 | - OrderBaseInfoDO baseInfoDO = new OrderBaseInfoDO(); | |
1415 | - BeanUtils.copyProperties(baseInfoVO, baseInfoDO); | |
1416 | - baseInfoDO.setOrderStatus(OrderStatusEnum.CREATE_FINISH.getStatus()); | |
1417 | - save(baseInfoDO); | |
1418 | - | |
1419 | - OrderProfitAnalysisVO profitAnalysisVO = orderAddVO.getProfitAnalysisInfo(); | |
1420 | - if (Objects.nonNull(profitAnalysisVO)) { | |
1421 | - OrderProfitAnalysisDO profitAnalysisDO = new OrderProfitAnalysisDO(); | |
1422 | - BeanUtils.copyProperties(profitAnalysisVO, profitAnalysisDO); | |
1423 | - profitAnalysisDO.setOrderId(baseInfoDO.getId()); | |
1424 | - profitAnalysisDO.setOrderStatus(OrderStatusEnum.PROFIT_WAIT_AUDIT.getStatus()); | |
1425 | - if (Objects.nonNull(profitAnalysisDO.getCustomerTotalPrice()) | |
1426 | - && Objects.nonNull(profitAnalysisDO.getExchangeRate()) | |
1427 | - && Objects.nonNull(profitAnalysisDO.getPacketTotalPrice()) | |
1428 | - && Objects.nonNull(profitAnalysisDO.getProductionDepartmentTotalPrice())) { | |
1429 | - profitAnalysisDO.setProfitRate(ProfitUtils.calculateProfitRate(ProfitCalculateVO.builder() | |
1430 | - .customerTotalPrice(profitAnalysisDO.getCustomerTotalPrice()) | |
1431 | - .exchangeRate(profitAnalysisDO.getExchangeRate()) | |
1432 | - .packetTotalPrice(profitAnalysisDO.getPacketTotalPrice()) | |
1433 | - .productionDepartmentTotalPrice(profitAnalysisDO.getProductionDepartmentTotalPrice()).build())); | |
1434 | - } | |
1435 | - | |
1436 | - profitAnalysisService.save(profitAnalysisDO); | |
1437 | - } | |
1438 | - | |
1439 | - OrderCompletionReportVO reportVO = orderAddVO.getReportInfo(); | |
1440 | - if (Objects.nonNull(reportVO)) { | |
1441 | - OrderCompletionReportDO reportDO = new OrderCompletionReportDO(); | |
1442 | - BeanUtils.copyProperties(reportVO, reportDO); | |
1443 | - reportDO.setOrderId(baseInfoDO.getId()); | |
1444 | - reportDO.setOrderStatus(OrderStatusEnum.REPORT_WAIT_AUDIT.getStatus()); | |
1445 | - reportService.save(reportDO); | |
1446 | - } | |
1447 | - | |
1448 | - OrderTrackStageVO trackStageVO = orderAddVO.getTrackStageInfo(); | |
1449 | - if (Objects.nonNull(trackStageVO)) { | |
1450 | - OrderTrackStageDO trackStageDO = new OrderTrackStageDO(); | |
1451 | - BeanUtils.copyProperties(trackStageVO, trackStageDO); | |
1452 | - trackStageDO.setOrderId(baseInfoDO.getId()); | |
1453 | - trackStageDO.setOrderStatus(OrderStatusEnum.TRACK_ING.getStatus()); | |
1454 | - trackStageService.save(trackStageDO); | |
1455 | - } | |
1456 | - | |
1457 | - OrderInspectionStageVO inspectionStageVO = orderAddVO.getInspectionStageInfo(); | |
1458 | - if (Objects.nonNull(inspectionStageVO)) { | |
1459 | - OrderInspectionStageDO inspectionStageDO = new OrderInspectionStageDO(); | |
1460 | - BeanUtils.copyProperties(inspectionStageVO, inspectionStageDO); | |
1461 | - inspectionStageDO.setOrderId(baseInfoDO.getId()); | |
1462 | - inspectionStageDO.setOrderStatus(OrderStatusEnum.INSPECT_ING.getStatus()); | |
1463 | - inspectionStageService.save(inspectionStageDO); | |
1464 | - } | |
1465 | - | |
1466 | - orderOptLogService.save(buildOrderOptLogDo(baseInfoDO.getId(), userId, OrderOptTypeEnum.ORDER_CREATE.getDesc(), null)); | |
1467 | - | |
1468 | - return ServerResult.success(); | |
1469 | - } | |
1470 | - | |
1471 | - /** | |
1472 | - * @param orderId | |
1473 | - * @param userId | |
1474 | - * @param optType | |
1475 | - * @param jsonString | |
1476 | - * @return | |
1477 | - */ | |
1478 | - private OrderOptLogDO buildOrderOptLogDo(Long orderId, Long userId, String optType, String jsonString) { | |
1479 | - return OrderOptLogDO.builder().orderId(orderId).userId(userId).fields(jsonString).optType(optType).build(); | |
1480 | - } | |
1481 | - | |
1482 | - /** | |
1483 | - * @param updateVO | |
1484 | - */ | |
1485 | - private void initOrderId(OrderUpdateVO updateVO) { | |
1486 | - if (Objects.nonNull(updateVO.getBaseInfo())) { | |
1487 | - updateVO.getBaseInfo().setId(updateVO.getOrderId()); | |
1488 | - } | |
1489 | - if (Objects.nonNull(updateVO.getReportInfo())) { | |
1490 | - updateVO.getReportInfo().setOrderId(updateVO.getOrderId()); | |
1491 | - } | |
1492 | - if (Objects.nonNull(updateVO.getInspectionStageInfo())) { | |
1493 | - updateVO.getInspectionStageInfo().setOrderId(updateVO.getOrderId()); | |
1494 | - } | |
1495 | - if (Objects.nonNull(updateVO.getProfitAnalysisInfo())) { | |
1496 | - updateVO.getProfitAnalysisInfo().setOrderId(updateVO.getOrderId()); | |
1497 | - } | |
1498 | - if (Objects.nonNull(updateVO.getTrackStageInfo())) { | |
1499 | - updateVO.getTrackStageInfo().setOrderId(updateVO.getOrderId()); | |
1500 | - } | |
1501 | - } | |
1502 | - | |
1503 | - /** | |
1504 | - * @param orderId | |
1505 | - * @param userId | |
1506 | - * @return | |
1507 | - */ | |
1508 | - public OrderFieldLockRecordDO lockProfitField(Long orderId, Long userId) { | |
1509 | - return OrderFieldLockRecordDO.builder().orderId(orderId).userId(userId).fields(JSONObject.toJSONString(OrderFieldUtils.initProfitAnalysisField(OrderLockFieldEnum.LOCKED))).build(); | |
1510 | - } | |
1511 | - | |
1512 | - /** | |
1513 | - * @param orderId | |
1514 | - * @param userId | |
1515 | - * @return | |
1516 | - */ | |
1517 | - public OrderFieldLockRecordDO lockReportField(Long orderId, Long userId) { | |
1518 | - return OrderFieldLockRecordDO.builder().orderId(orderId).userId(userId).fields(JSONObject.toJSONString(OrderFieldUtils.initReportField(OrderLockFieldEnum.LOCKED))).build(); | |
1519 | - } | |
1520 | - | |
1521 | - /** | |
1522 | - * @param profitAnalysisVO | |
1523 | - * @param orderBaseInfoDo | |
1524 | - * @param userId | |
1525 | - */ | |
1526 | - public OrderFieldLockApplyDO handlerProfitRate(OrderProfitAnalysisVO profitAnalysisVO, OrderBaseInfoDO | |
1527 | - orderBaseInfoDo, Long userId) { | |
1528 | - OrderProfitAnalysisFieldVO profitAnalysisFieldVO = profitAnalysis2profitAnalysisField(orderBaseInfoDo, profitAnalysisVO); | |
1529 | - | |
1530 | - SystemSettingDO systemSettingDO = systemSettingService.getOne(new LambdaQueryWrapper<SystemSettingDO>() | |
1531 | - .eq(BaseDO::getEnableFlag, Constant.ENABLE_TEN) | |
1532 | - .eq(SystemSettingDO::getSettingCode, "customerCode") | |
1533 | - .eq(SystemSettingDO::getSettingValue, orderBaseInfoDo.getCustomerCode()) | |
1534 | - .eq(SystemSettingDO::getRelationCode, "profitRate").last("limit 1")); | |
1535 | - | |
1536 | - double profitRate = Objects.nonNull(systemSettingDO) ? Double.parseDouble(systemSettingDO.getRelationValue()) : 0.3; | |
1537 | - OrderFieldLockApplyDO orderFieldLockApplyDO = buildProfitFieldLockApplyDO(profitAnalysisFieldVO, userId); | |
1538 | - orderFieldLockApplyService.save(orderFieldLockApplyDO); | |
1539 | - | |
1540 | - if (Double.parseDouble(profitAnalysisFieldVO.getProfitRate()) >= profitRate && !profitAnalysisVO.getIsEditPacketPrice()) { | |
1541 | - // 直接通过 | |
1542 | - orderFieldLockApplyService.doAudit(AuditVO.builder() | |
1543 | - .id(orderFieldLockApplyDO.getId()) | |
1544 | - .status(ApplyStatusEnum.AUDIT_PASS.getStatus()) | |
1545 | - .build()); | |
1546 | - orderFieldLockApplyDO.setStatus(ApplyStatusEnum.AUDIT_PASS.getStatus()); | |
1547 | - } | |
1548 | - return orderFieldLockApplyDO; | |
1549 | - } | |
1550 | - | |
1551 | - /** | |
1552 | - * 修改数据 | |
1553 | - * | |
1554 | - * @param updateVO 实例对象 | |
1555 | - * @return 实例对象 | |
1556 | - */ | |
1557 | - @Override | |
1558 | - @Transactional | |
1559 | - public ServerResult edit(OrderUpdateVO updateVO) { | |
1560 | - | |
1561 | - //todo 校验 | |
1562 | - if (Objects.isNull(updateVO.getOrderId())) { | |
1563 | - return ServerResult.fail("id 不能为空"); | |
1564 | - } | |
1565 | - initOrderId(updateVO); | |
1566 | - Long userId = dataScope.getLoginUserId(); | |
1567 | - OrderBaseInfoDO orderBaseInfoDo = getById(updateVO.getOrderId()); | |
1568 | - if (Objects.isNull(orderBaseInfoDo)) { | |
1569 | - throw new BusinessException(ServerResultCode.ORDER_BASE_INFO_EMPTY); | |
1570 | - } | |
1571 | - OrderOptLogDO optLogDO = new OrderOptLogDO(); | |
1572 | - if (Objects.nonNull(updateVO.getBaseInfo())) { | |
1573 | - buildUpdateVO(updateVO.getBaseInfo(), orderBaseInfoDo); | |
1574 | - orderBaseInfoDo.setId(updateVO.getOrderId()); | |
1575 | - optLogDO = buildOrderOptLogDo(updateVO.getOrderId(), userId, OrderOptTypeEnum.ORDER_EDIT.getDesc(), JSONObject.toJSONString(updateVO)); | |
1576 | - clearLockedField(updateVO.getOrderId(), userId, LockedFieldTypeEnum.ORDER_BASE); | |
1577 | - } | |
1578 | - if (Objects.nonNull(updateVO.getProfitAnalysisInfo())) { | |
1579 | - checkApply(updateVO.getOrderId(), userId, ApplyTypeEnum.ORDER_PROFIT_APPLY); | |
1580 | - OrderFieldLockApplyDO orderFieldLockApplyDO = handlerProfitRate(updateVO.getProfitAnalysisInfo(), orderBaseInfoDo, userId); | |
1581 | - | |
1582 | - orderBaseInfoDo.setOrderStatus(ApplyStatusEnum.AUDIT_PASS.getStatus().equals(orderFieldLockApplyDO.getStatus()) ? OrderStatusEnum.PROFIT_AUDIT_PASS.getStatus() | |
1583 | - : OrderStatusEnum.PROFIT_WAIT_AUDIT.getStatus()); | |
1584 | - optLogDO = buildOrderOptLogDo(updateVO.getOrderId(), userId, OrderOptTypeEnum.ORDER_PROFIT_EDIT_APPLY.getDesc(), orderFieldLockApplyDO.getFields()); | |
1585 | - clearLockedField(updateVO.getOrderId(), userId, LockedFieldTypeEnum.ORDER_PROFIT); | |
1586 | - } | |
1587 | - | |
1588 | - if (Objects.nonNull(updateVO.getReportInfo())) { | |
1589 | - checkApply(updateVO.getOrderId(), userId, ApplyTypeEnum.ORDER_REPORT_APPLY); | |
1590 | - OrderFieldLockApplyDO orderFieldLockApplyDO = buildReportFieldLockApplyDO(updateVO.getReportInfo(), userId); | |
1591 | - orderFieldLockApplyService.save(orderFieldLockApplyDO); | |
1592 | - | |
1593 | - orderBaseInfoDo.setOrderStatus(OrderStatusEnum.REPORT_WAIT_AUDIT.getStatus()); | |
1594 | - optLogDO = buildOrderOptLogDo(updateVO.getOrderId(), userId, OrderOptTypeEnum.ORDER_REPORT_EDIT_APPLY.getDesc(), orderFieldLockApplyDO.getFields()); | |
1595 | - clearLockedField(updateVO.getOrderId(), userId, LockedFieldTypeEnum.ORDER_REPORT); | |
1596 | - } | |
1597 | - | |
1598 | - if (Objects.nonNull(updateVO.getTrackStageInfo())) { | |
1599 | - OrderTrackStageDO trackStageDO = trackStageService.getOne(new LambdaQueryWrapper<OrderTrackStageDO>() | |
1600 | - .eq(BaseDO::getEnableFlag, Constant.ENABLE_TEN) | |
1601 | - .eq(OrderTrackStageDO::getOrderId, updateVO.getOrderId())); | |
1602 | - OrderTrackStageVO trackStageInfo = updateVO.getTrackStageInfo(); | |
1603 | - if (Objects.nonNull(trackStageDO)) { | |
1604 | - if (StringUtils.isNotBlank(trackStageInfo.getPpTime())) { | |
1605 | - trackStageDO.setPpTime(trackStageInfo.getPpTime()); | |
1606 | - } | |
1607 | - if (StringUtils.isNotBlank(trackStageInfo.getPpConfirmResult())) { | |
1608 | - trackStageDO.setPpConfirmResult(trackStageInfo.getPpConfirmResult()); | |
1609 | - } | |
1610 | - if (StringUtils.isNotBlank(trackStageInfo.getEsoSampleSendTime())) { | |
1611 | - trackStageDO.setEsoSampleSendTime(trackStageInfo.getEsoSampleSendTime()); | |
1612 | - } | |
1613 | - if (StringUtils.isNotBlank(trackStageInfo.getShippmentSampleSendTime())) { | |
1614 | - trackStageDO.setShippmentSampleSendTime(trackStageInfo.getShippmentSampleSendTime()); | |
1615 | - } | |
1616 | - if (StringUtils.isNotBlank(trackStageInfo.getShippmentSampleConfirmResult())) { | |
1617 | - trackStageDO.setShippmentSampleConfirmResult(trackStageInfo.getShippmentSampleConfirmResult()); | |
1618 | - } | |
1619 | - if (StringUtils.isNotBlank(trackStageInfo.getSelfTestPassTime())) { | |
1620 | - trackStageDO.setSelfTestPassTime(trackStageInfo.getSelfTestPassTime()); | |
1621 | - } | |
1622 | - if (StringUtils.isNotBlank(trackStageInfo.getAitexTestSendTime())) { | |
1623 | - trackStageDO.setAitexTestSendTime(trackStageInfo.getAitexTestSendTime()); | |
1624 | - } | |
1625 | - if (StringUtils.isNotBlank(trackStageInfo.getAitexTestFinishResult())) { | |
1626 | - trackStageDO.setAitexTestFinishResult(trackStageInfo.getAitexTestFinishResult()); | |
1627 | - } | |
1628 | - if (StringUtils.isNotBlank(trackStageInfo.getSgsTestSendTime())) { | |
1629 | - trackStageDO.setSgsTestSendTime(trackStageInfo.getSgsTestSendTime()); | |
1630 | - } | |
1631 | - if (StringUtils.isNotBlank(trackStageInfo.getSgsTestFinishResult())) { | |
1632 | - trackStageDO.setSgsTestFinishResult(trackStageInfo.getSgsTestFinishResult()); | |
1633 | - } | |
1634 | - if (StringUtils.isNotBlank(trackStageInfo.getBarcodeStickerArrivalTime())) { | |
1635 | - trackStageDO.setBarcodeStickerArrivalTime(trackStageInfo.getBarcodeStickerArrivalTime()); | |
1636 | - } | |
1637 | - if (StringUtils.isNotBlank(trackStageInfo.getLatestArrivalTime())) { | |
1638 | - trackStageDO.setLatestArrivalTime(trackStageInfo.getLatestArrivalTime()); | |
1639 | - } | |
1640 | - if (StringUtils.isNotBlank(trackStageInfo.getLatestBkTime())) { | |
1641 | - trackStageDO.setLatestBkTime(trackStageInfo.getLatestBkTime()); | |
1642 | - } | |
1643 | - trackStageDO.setOrderId(updateVO.getOrderId()); | |
1644 | - trackStageDO.setOrderStatus(OrderStatusEnum.TRACK_ING.getStatus()); | |
1645 | - trackStageService.updateById(trackStageDO); | |
1646 | - } else { | |
1647 | - trackStageDO = new OrderTrackStageDO(); | |
1648 | - BeanUtils.copyProperties(updateVO.getTrackStageInfo(), trackStageDO); | |
1649 | - trackStageDO.setOrderId(updateVO.getOrderId()); | |
1650 | - trackStageDO.setOrderStatus(OrderStatusEnum.TRACK_ING.getStatus()); | |
1651 | - trackStageService.save(trackStageDO); | |
1652 | - } | |
1653 | - orderBaseInfoDo.setOrderStatus(OrderStatusEnum.TRACK_ING.getStatus()); | |
1654 | - optLogDO = buildOrderOptLogDo(updateVO.getOrderId(), userId, OrderOptTypeEnum.ORDER_TRACKER_EDIT_APPLY.getDesc(), JSONObject.toJSONString(updateVO)); | |
1655 | - clearLockedField(updateVO.getOrderId(), userId, LockedFieldTypeEnum.ORDER_TRACKER); | |
1656 | - } | |
1657 | - | |
1658 | - if (Objects.nonNull(updateVO.getInspectionStageInfo())) { | |
1659 | - OrderInspectionStageDO inspectionStageDO = inspectionStageService.getOne(new LambdaQueryWrapper<OrderInspectionStageDO>() | |
1660 | - .eq(BaseDO::getEnableFlag, Constant.ENABLE_TEN) | |
1661 | - .eq(OrderInspectionStageDO::getOrderId, updateVO.getOrderId())); | |
1662 | - OrderInspectionStageVO inspectionStageInfo = updateVO.getInspectionStageInfo(); | |
1663 | - if (Objects.nonNull(inspectionStageDO)) { | |
1664 | - if (StringUtils.isNotBlank(inspectionStageInfo.getMidCheckApplyTime())) { | |
1665 | - inspectionStageDO.setMidCheckApplyTime(inspectionStageInfo.getMidCheckApplyTime()); | |
1666 | - } | |
1667 | - if (StringUtils.isNotBlank(inspectionStageInfo.getMidCheckComment())) { | |
1668 | - inspectionStageDO.setMidCheckComment(inspectionStageInfo.getMidCheckComment()); | |
1669 | - } | |
1670 | - if (StringUtils.isNotBlank(inspectionStageInfo.getMidCheckResult())) { | |
1671 | - inspectionStageDO.setMidCheckResult(inspectionStageInfo.getMidCheckResult()); | |
1672 | - } | |
1673 | - if (StringUtils.isNotBlank(inspectionStageInfo.getEndCheckApplyTime())) { | |
1674 | - inspectionStageDO.setEndCheckApplyTime(inspectionStageInfo.getEndCheckApplyTime()); | |
1675 | - } | |
1676 | - if (StringUtils.isNotBlank(inspectionStageInfo.getEndCheckResult())) { | |
1677 | - inspectionStageDO.setEndCheckResult(inspectionStageInfo.getEndCheckResult()); | |
1678 | - } | |
1679 | - if (StringUtils.isNotBlank(inspectionStageInfo.getSpecification())) { | |
1680 | - inspectionStageDO.setSpecification(inspectionStageInfo.getSpecification()); | |
1681 | - } | |
1682 | - if (StringUtils.isNotBlank(inspectionStageInfo.getFunctionality())) { | |
1683 | - inspectionStageDO.setFunctionality(inspectionStageInfo.getFunctionality()); | |
1684 | - } | |
1685 | - if (StringUtils.isNotBlank(inspectionStageInfo.getElectroplate())) { | |
1686 | - inspectionStageDO.setElectroplate(inspectionStageInfo.getElectroplate()); | |
1687 | - } | |
1688 | - if (StringUtils.isNotBlank(inspectionStageInfo.getValue1())) { | |
1689 | - inspectionStageDO.setValue1(inspectionStageInfo.getValue1()); | |
1690 | - } | |
1691 | - if (StringUtils.isNotBlank(inspectionStageInfo.getValue2())) { | |
1692 | - inspectionStageDO.setValue2(inspectionStageInfo.getValue2()); | |
1693 | - } | |
1694 | - if (StringUtils.isNotBlank(inspectionStageInfo.getValue3())) { | |
1695 | - inspectionStageDO.setValue3(inspectionStageInfo.getValue3()); | |
1696 | - } | |
1697 | - if (StringUtils.isNotBlank(inspectionStageInfo.getBoxPacket())) { | |
1698 | - inspectionStageDO.setBoxPacket(inspectionStageInfo.getBoxPacket()); | |
1699 | - } | |
1700 | - inspectionStageDO.setOrderId(updateVO.getOrderId()); | |
1701 | - inspectionStageDO.setOrderStatus(OrderStatusEnum.INSPECT_ING.getStatus()); | |
1702 | - inspectionStageService.updateById(inspectionStageDO); | |
1703 | - } else { | |
1704 | - inspectionStageDO = new OrderInspectionStageDO(); | |
1705 | - BeanUtils.copyProperties(updateVO.getInspectionStageInfo(), inspectionStageDO); | |
1706 | - inspectionStageDO.setOrderId(updateVO.getOrderId()); | |
1707 | - inspectionStageDO.setOrderStatus(OrderStatusEnum.INSPECT_ING.getStatus()); | |
1708 | - inspectionStageService.save(inspectionStageDO); | |
1709 | - } | |
1710 | - orderBaseInfoDo.setOrderStatus(OrderStatusEnum.INSPECT_ING.getStatus()); | |
1711 | - optLogDO = buildOrderOptLogDo(updateVO.getOrderId(), userId, OrderOptTypeEnum.ORDER_INSPECT_EDIT_APPLY.getDesc(), JSONObject.toJSONString(updateVO)); | |
1712 | - clearLockedField(updateVO.getOrderId(), userId, LockedFieldTypeEnum.ORDER_INSPECT); | |
1713 | - } | |
1714 | - updateById(orderBaseInfoDo); | |
1715 | - orderOptLogService.save(optLogDO); | |
1716 | - return ServerResult.success(); | |
1717 | - } | |
1718 | - | |
1719 | - /** | |
1720 | - * @param orderId | |
1721 | - * @param userId | |
1722 | - */ | |
1723 | - public void clearLockedField(Long orderId, Long userId, LockedFieldTypeEnum fieldTypeEnum) { | |
1724 | - OrderFieldLockRecordDO recordDO = fieldLockRecordService.getOne(new LambdaQueryWrapper<OrderFieldLockRecordDO>() | |
1725 | - .eq(BaseDO::getEnableFlag, Constant.ENABLE_TEN) | |
1726 | - .eq(OrderFieldLockRecordDO::getOrderId, orderId) | |
1727 | - .eq(OrderFieldLockRecordDO::getUserId, userId) | |
1728 | - .orderByDesc(OrderFieldLockRecordDO::getId) | |
1729 | - .last("limit 1")); | |
1730 | - if (Objects.nonNull(recordDO)) { | |
1731 | - OrderLockFieldVO fieldVO = JSONObject.parseObject(recordDO.getFields(), OrderLockFieldVO.class); | |
1732 | - if (LockedFieldTypeEnum.ORDER_BASE.equals(fieldTypeEnum)) { | |
1733 | - fieldVO.setBaseFields(OrderFieldUtils.initOrderBaseField(OrderLockFieldEnum.LOCKED)); | |
1734 | - } | |
1735 | - if (LockedFieldTypeEnum.ORDER_PROFIT.equals(fieldTypeEnum)) { | |
1736 | - fieldVO.setProfitAnalysisFields(OrderFieldUtils.initProfitAnalysisField(OrderLockFieldEnum.LOCKED)); | |
1737 | - } | |
1738 | - if (LockedFieldTypeEnum.ORDER_REPORT.equals(fieldTypeEnum)) { | |
1739 | - fieldVO.setReportFields(OrderFieldUtils.initReportField(OrderLockFieldEnum.LOCKED)); | |
1740 | - } | |
1741 | - if (LockedFieldTypeEnum.ORDER_TRACKER.equals(fieldTypeEnum)) { | |
1742 | - fieldVO.setTrackStageFields(OrderFieldUtils.initTrackStageField(OrderLockFieldEnum.LOCKED)); | |
1743 | - } | |
1744 | - if (LockedFieldTypeEnum.ORDER_INSPECT.equals(fieldTypeEnum)) { | |
1745 | - fieldVO.setInspectionStageFields(OrderFieldUtils.initInspectionStageField(OrderLockFieldEnum.LOCKED)); | |
1746 | - } | |
1747 | - recordDO.setFields(JSONObject.toJSONString(fieldVO)); | |
1748 | - fieldLockRecordService.updateById(recordDO); | |
1749 | - } | |
1750 | - } | |
1751 | - | |
1752 | - /** | |
1753 | - * @param baseInfoVO | |
1754 | - * @param baseInfoDO | |
1755 | - */ | |
1756 | - private void buildUpdateVO(OrderBaseInfoVO baseInfoVO, OrderBaseInfoDO baseInfoDO) { | |
1757 | - if (Objects.isNull(baseInfoVO)) { | |
1758 | - return; | |
1759 | - } | |
1760 | - if (StringUtils.isNotBlank(baseInfoVO.getCustomerCode())) { | |
1761 | - baseInfoDO.setCustomerCode(baseInfoVO.getCustomerCode()); | |
1762 | - } | |
1763 | - if (StringUtils.isNotBlank(baseInfoVO.getProjectNo())) { | |
1764 | - baseInfoDO.setProjectNo(baseInfoVO.getProjectNo()); | |
1765 | - } | |
1766 | - if (StringUtils.isNotBlank(baseInfoVO.getProductionDepartment())) { | |
1767 | - baseInfoDO.setProductionDepartment(baseInfoVO.getProductionDepartment()); | |
1768 | - } | |
1769 | - if (StringUtils.isNotBlank(baseInfoVO.getInnerNo())) { | |
1770 | - baseInfoDO.setInnerNo(baseInfoVO.getInnerNo()); | |
1771 | - } | |
1772 | - if (StringUtils.isNotBlank(baseInfoVO.getCustomerPo())) { | |
1773 | - baseInfoDO.setCustomerPo(baseInfoVO.getCustomerPo()); | |
1774 | - } | |
1775 | - if (StringUtils.isNotBlank(baseInfoVO.getCustomerStyle())) { | |
1776 | - baseInfoDO.setCustomerStyle(baseInfoVO.getCustomerStyle()); | |
1777 | - } | |
1778 | - if (StringUtils.isNotBlank(baseInfoVO.getModeleLo())) { | |
1779 | - baseInfoDO.setModeleLo(baseInfoVO.getModeleLo()); | |
1780 | - } | |
1781 | - if (StringUtils.isNotBlank(baseInfoVO.getCollection())) { | |
1782 | - baseInfoDO.setCollection(baseInfoVO.getCollection()); | |
1783 | - } | |
1784 | - if (StringUtils.isNotBlank(baseInfoVO.getPoColor())) { | |
1785 | - baseInfoDO.setPoColor(baseInfoVO.getPoColor()); | |
1786 | - } | |
1787 | - if (StringUtils.isNotBlank(baseInfoVO.getCnColor())) { | |
1788 | - baseInfoDO.setCnColor(baseInfoVO.getCnColor()); | |
1789 | - } | |
1790 | - if (StringUtils.isNotBlank(baseInfoVO.getPicUrl())) { | |
1791 | - baseInfoDO.setPicUrl(baseInfoVO.getPicUrl()); | |
1792 | - } | |
1793 | - if (StringUtils.isNotBlank(baseInfoVO.getSmallPicUrl())) { | |
1794 | - baseInfoDO.setSmallPicUrl(baseInfoVO.getSmallPicUrl()); | |
1795 | - } | |
1796 | - if (StringUtils.isNotBlank(baseInfoVO.getProductionComment())) { | |
1797 | - baseInfoDO.setProductionComment(baseInfoVO.getProductionComment()); | |
1798 | - } | |
1799 | - if (Objects.nonNull(baseInfoVO.getOrderCount())) { | |
1800 | - baseInfoDO.setOrderCount(baseInfoVO.getOrderCount()); | |
1801 | - checkChargeOrderCount(Arrays.asList(baseInfoVO.getId())); | |
1802 | - } | |
1803 | - if (StringUtils.isNotBlank(baseInfoVO.getOrderComposition())) { | |
1804 | - baseInfoDO.setOrderComposition(baseInfoVO.getOrderComposition()); | |
1805 | - } | |
1806 | - if (StringUtils.isNotBlank(baseInfoVO.getProductStyle())) { | |
1807 | - baseInfoDO.setProductStyle(baseInfoVO.getProductStyle()); | |
1808 | - } | |
1809 | - if (StringUtils.isNotBlank(baseInfoVO.getProductionDepartmentConsignTime())) { | |
1810 | - baseInfoDO.setProductionDepartmentConsignTime(baseInfoVO.getProductionDepartmentConsignTime()); | |
1811 | - } | |
1812 | - if (StringUtils.isNotBlank(baseInfoVO.getOrderHodTime())) { | |
1813 | - baseInfoDO.setOrderHodTime(baseInfoVO.getOrderHodTime()); | |
1814 | - } | |
1815 | - if (StringUtils.isNotBlank(baseInfoVO.getOutboundType())) { | |
1816 | - baseInfoDO.setOutboundType(baseInfoVO.getOutboundType()); | |
1817 | - } | |
1818 | - if (StringUtils.isNotBlank(baseInfoVO.getPacketType())) { | |
1819 | - baseInfoDO.setPacketType(baseInfoVO.getPacketType()); | |
1820 | - } | |
1821 | - if (StringUtils.isNotBlank(baseInfoVO.getBusinessPerson())) { | |
1822 | - baseInfoDO.setBusinessPerson(baseInfoVO.getBusinessPerson()); | |
1823 | - } | |
1824 | - } | |
1825 | - | |
1826 | - /** | |
1827 | - * 通过主键删除数据 | |
1828 | - * | |
1829 | - * @param orderBaseInfoQueryVO 筛选条件 | |
1830 | - * @return 是否成功 | |
1831 | - */ | |
1832 | - @Override | |
1833 | - @Transactional | |
1834 | - public ServerResult deleteById(OrderBaseInfoQueryVO orderBaseInfoQueryVO) { | |
1835 | - List<Long> ids = orderBaseInfoQueryVO.getIds(); | |
1836 | - if (CollUtil.isEmpty(ids)) { | |
1837 | - return ServerResult.fail("ids 参数不能为空"); | |
1838 | - } | |
1839 | - Long userId = dataScope.getLoginUserId(); | |
1840 | - List<OrderBaseInfoDO> orderBaseInfoList = listByIds(ids); | |
1841 | - if (CollUtil.isEmpty(orderBaseInfoList)) { | |
1842 | - return ServerResult.success(); | |
1843 | - } | |
1844 | - //todo 校验是否可以逻辑删除 | |
1845 | - //订单基本信息 | |
1846 | - LambdaUpdateWrapper<OrderBaseInfoDO> updateWrapper = new LambdaUpdateWrapper<OrderBaseInfoDO>() | |
1847 | - .in(OrderBaseInfoDO::getId, ids) | |
1848 | - .set(OrderBaseInfoDO::getEnableFlag, Constant.UNABLE_TWENTY); | |
1849 | - update(updateWrapper); | |
1850 | - | |
1851 | - | |
1852 | - //删除订单关联信息 | |
1853 | - //订单审批日志 | |
1854 | - orderAuditLogService.deleteByOrderIds(ids); | |
1855 | - | |
1856 | - //订单-项目完成报告书 | |
1857 | - orderCompletionReportService.deleteByOrderIds(ids); | |
1858 | - | |
1859 | - //用户订单-字段锁定申请表 | |
1860 | - orderFieldLockApplyService.deleteByOrderIds(ids); | |
1861 | - | |
1862 | - //用户订单-字段锁定记录表 | |
1863 | - orderFieldLockRecordService.deleteByOrderIds(ids); | |
1864 | - | |
1865 | - //订单-质检环节 | |
1866 | - orderInspectionStageService.deleteByOrderIds(ids); | |
1867 | - | |
1868 | - //用户订单操作日志表 | |
1869 | - orderOptLogService.deleteByOrderIds(ids); | |
1870 | - | |
1871 | - //订单利润分析表 | |
1872 | - profitAnalysisService.deleteByOrderIds(ids); | |
1873 | - | |
1874 | - //订单-跟单环节 | |
1875 | - trackStageService.deleteByOrderIds(ids); | |
1876 | - | |
1877 | - List<OrderOptLogDO> orderOptLogDOS = ids.stream().map(x -> { | |
1878 | - return buildOrderOptLogDo(x, userId, OrderOptTypeEnum.ORDER_DELETE.getDesc(), null); | |
1879 | - }).collect(Collectors.toList()); | |
1880 | - orderOptLogService.saveBatch(orderOptLogDOS); | |
1881 | - return ServerResult.success(); | |
1882 | - } | |
1883 | - | |
1884 | - /** | |
1885 | - * 根据订单状态统计订单数量 | |
1886 | - * | |
1887 | - * @param orderStatus | |
1888 | - * @return | |
1889 | - */ | |
1890 | - @Override | |
1891 | - public long countByOrderStatus(Integer orderStatus) { | |
1892 | - return this.count(new LambdaQueryWrapper<OrderBaseInfoDO>().eq(OrderBaseInfoDO::getOrderStatus, orderStatus) | |
1893 | - .eq(OrderBaseInfoDO::getEnableFlag, Constant.ENABLE_TEN)); | |
1894 | - } | |
1895 | - | |
1896 | - @Override | |
1897 | - public long countRecentMonthByOrderStatus(Integer orderStatus) { | |
1898 | - return this.baseMapper.countRecentMonthByOrderStatus(orderStatus); | |
1899 | - } | |
1900 | - | |
1901 | - @Override | |
1902 | - public List<Map<String, Integer>> countDaysOrder() { | |
1903 | - return this.baseMapper.countDaysOrder(); | |
1904 | - } | |
1905 | - | |
1906 | - @Override | |
1907 | - public long countAll() { | |
1908 | - return this.count(new LambdaQueryWrapper<OrderBaseInfoDO>().eq(OrderBaseInfoDO::getEnableFlag, Constant.ENABLE_TEN)); | |
1909 | - } | |
1910 | - | |
1911 | - @Override | |
1912 | - public long countRecentYear() { | |
1913 | - return this.baseMapper.countRecentYear(); | |
1914 | - } | |
1915 | - | |
1916 | - | |
1917 | - @Override | |
1918 | - public ServerResult checkChargeOrderCount(List<Long> ids) { | |
1919 | - LambdaQueryWrapper<OrderBaseInfoDO> queryWrapper = new LambdaQueryWrapper<OrderBaseInfoDO>() | |
1920 | - .eq(BaseDO::getEnableFlag, Constant.ENABLE_TEN) | |
1921 | - .in(CollectionUtils.isNotEmpty(ids), OrderBaseInfoDO::getId, ids) | |
1922 | - .ne(OrderBaseInfoDO::getOrderStatus, OrderStatusEnum.ORDER_FINISH.getStatus()); | |
1923 | - List<OrderBaseInfoDO> ordersDOS = list(queryWrapper); | |
1924 | - | |
1925 | - List<OrderInfoResultVO> orderInfoResultVOS = wrapperOrderResultList(false, ordersDOS); | |
1926 | - if (CollectionUtils.isNotEmpty(orderInfoResultVOS)) { | |
1927 | - Set<Long> orderIds = orderInfoResultVOS.stream().map(OrderInfoResultVO::getId).collect(Collectors.toSet()); | |
1928 | - if (CollectionUtils.isNotEmpty(orderIds)) { | |
1929 | - List<OrderProfitAnalysisDO> profitAnalysisDOS = profitAnalysisService.list(new LambdaQueryWrapper<OrderProfitAnalysisDO>() | |
1930 | - .eq(BaseDO::getEnableFlag, Constant.ENABLE_TEN) | |
1931 | - .in(OrderProfitAnalysisDO::getOrderId, orderIds)); | |
1932 | - | |
1933 | - Map<Long, OrderProfitAnalysisDO> profitAnalysisDOMap = new HashMap<>(); | |
1934 | - if (CollectionUtils.isNotEmpty(profitAnalysisDOS)) { | |
1935 | - profitAnalysisDOMap = profitAnalysisDOS.stream().collect(Collectors.toMap(OrderProfitAnalysisDO::getOrderId, Function.identity(), (x, y) -> y)); | |
1936 | - } | |
1937 | - | |
1938 | - for (OrderInfoResultVO resultVO : orderInfoResultVOS) { | |
1939 | - if (profitAnalysisDOMap.containsKey(resultVO.getId())) { | |
1940 | - OrderProfitAnalysisDO profitAnalysisDO = profitAnalysisDOMap.get(resultVO.getId()); | |
1941 | - Integer orderCount = resultVO.getOrderCount(); | |
1942 | - BigDecimal customerTotalPrice = new BigDecimal(profitAnalysisDO.getCustomerTotalPrice()).setScale(Constant.TWO, RoundingMode.HALF_UP); | |
1943 | - BigDecimal customerPrice = new BigDecimal(profitAnalysisDO.getCustomerPrice()).setScale(Constant.TWO, RoundingMode.HALF_UP); | |
1944 | - | |
1945 | - BigDecimal calculateTotalPrice = new BigDecimal(orderCount).multiply(customerPrice).setScale(Constant.TWO, RoundingMode.HALF_UP); | |
1946 | - if (customerTotalPrice.compareTo(calculateTotalPrice) != Constant.ZERO) { | |
1947 | - BigDecimal customerRmbPrice = new BigDecimal(profitAnalysisDO.getCustomerRmbPrice()); | |
1948 | - BigDecimal customerRmbTotalPrice = new BigDecimal(orderCount).multiply(customerRmbPrice).setScale(Constant.TWO, RoundingMode.HALF_UP); | |
1949 | - BigDecimal productionDepartmentPrice = new BigDecimal(profitAnalysisDO.getProductionDepartmentPrice()); | |
1950 | - BigDecimal productionDepartmentTotalPrice = new BigDecimal(orderCount).multiply(productionDepartmentPrice).setScale(Constant.TWO, RoundingMode.HALF_UP); | |
1951 | - BigDecimal packetPrice = new BigDecimal(profitAnalysisDO.getPacketPrice()); | |
1952 | - BigDecimal packetTotalPrice = new BigDecimal(orderCount).multiply(packetPrice).setScale(Constant.TWO, RoundingMode.HALF_UP); | |
1953 | - Double profitRate = ProfitUtils.calculateProfitRate(ProfitCalculateVO.builder() | |
1954 | - .exchangeRate(profitAnalysisDO.getExchangeRate()) | |
1955 | - .profitType(profitAnalysisDO.getProfitType()) | |
1956 | - .customerTotalPrice(calculateTotalPrice.doubleValue()) | |
1957 | - .productionDepartmentTotalPrice(productionDepartmentTotalPrice.doubleValue()) | |
1958 | - .packetTotalPrice(packetTotalPrice.doubleValue()).build()); | |
1959 | - | |
1960 | - profitAnalysisDO.setCustomerTotalPrice(calculateTotalPrice.doubleValue()); | |
1961 | - profitAnalysisDO.setCustomerRmbTotalPrice(customerRmbTotalPrice.doubleValue()); | |
1962 | - profitAnalysisDO.setProductionDepartmentTotalPrice(productionDepartmentTotalPrice.doubleValue()); | |
1963 | - profitAnalysisDO.setPacketTotalPrice(packetTotalPrice.doubleValue()); | |
1964 | - profitAnalysisDO.setProfitRate(profitRate); | |
1965 | - profitAnalysisService.updateById(profitAnalysisDO); | |
1966 | - } | |
1967 | - } | |
1968 | - } | |
1969 | - } | |
1970 | - } | |
1971 | - return ServerResult.success(); | |
1972 | - } | |
1973 | -} |
src/main/java/com/order/erp/service/order/impl/OrderCompletionReportServiceImpl.java deleted
100644 → 0
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.toolkit.CollectionUtils; | |
8 | -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | |
9 | -import com.order.erp.common.constant.Constant; | |
10 | -import com.order.erp.common.constant.ServerResult; | |
11 | -import com.order.erp.common.excel4j.ExcelUtils; | |
12 | -import com.order.erp.common.excel4j.exceptions.Excel4JException; | |
13 | -import com.order.erp.domain.dto.order.OrderBaseInfoDO; | |
14 | -import com.order.erp.domain.dto.order.OrderCompletionReportDO; | |
15 | -import com.order.erp.domain.vo.OrderReportAnalysisExportVo; | |
16 | -import com.order.erp.domain.vo.OrderReportAnalysisResultVo; | |
17 | -import com.order.erp.domain.vo.OrderReportStatExportVo; | |
18 | -import com.order.erp.domain.vo.order.OrderBaseInfoQueryVO; | |
19 | -import com.order.erp.domain.vo.order.OrderCompletionReportQueryVO; | |
20 | -import com.order.erp.domain.vo.order.OrderCompletionReportVO; | |
21 | -import com.order.erp.domain.vo.order.OrderReportResultVO; | |
22 | -import com.order.erp.mapper.order.OrderCompletionReportMapper; | |
23 | -import com.order.erp.service.order.OrderBaseInfoService; | |
24 | -import com.order.erp.service.order.OrderCompletionReportService; | |
25 | -import lombok.extern.slf4j.Slf4j; | |
26 | -import org.springframework.stereotype.Service; | |
27 | - | |
28 | -import javax.annotation.Resource; | |
29 | -import javax.servlet.http.HttpServletResponse; | |
30 | -import java.io.IOException; | |
31 | -import java.math.BigDecimal; | |
32 | -import java.math.RoundingMode; | |
33 | -import java.util.*; | |
34 | -import java.util.function.Function; | |
35 | -import java.util.stream.Collectors; | |
36 | - | |
37 | -/** | |
38 | - * 订单-项目完成报告书(OrderCompletionReport)表服务实现类 | |
39 | - * | |
40 | - * @author makejava | |
41 | - * @since 2023-09-08 15:26:44 | |
42 | - */ | |
43 | -@Slf4j | |
44 | -@Service | |
45 | -public class OrderCompletionReportServiceImpl extends ServiceImpl<OrderCompletionReportMapper, OrderCompletionReportDO> implements OrderCompletionReportService { | |
46 | - | |
47 | - | |
48 | - @Resource | |
49 | - private OrderBaseInfoService orderBaseInfoService; | |
50 | - | |
51 | - /** | |
52 | - * 通过ID查询单条数据 | |
53 | - * <p> | |
54 | - * orderCompletionReportQueryVO 主键 | |
55 | - * | |
56 | - * @return 实例对象 | |
57 | - */ | |
58 | - @Override | |
59 | - public ServerResult queryById(OrderCompletionReportQueryVO orderCompletionReportQueryVO) { | |
60 | - if (Objects.isNull(orderCompletionReportQueryVO.getId())) { | |
61 | - return ServerResult.fail("id 不能为空"); | |
62 | - } | |
63 | - OrderCompletionReportDO OrderCompletionReportDo = getById(orderCompletionReportQueryVO.getId()); | |
64 | - if (Objects.isNull(OrderCompletionReportDo)) { | |
65 | - return ServerResult.success(null); | |
66 | - } | |
67 | - return ServerResult.success(BeanUtil.copyProperties(OrderCompletionReportDo, OrderCompletionReportVO.class)); | |
68 | - } | |
69 | - | |
70 | - /** | |
71 | - * 分页查询 | |
72 | - * | |
73 | - * @param orderCompletionReportQueryVO 筛选条件 | |
74 | - * @return 查询结果 | |
75 | - */ | |
76 | - @Override | |
77 | - public ServerResult list(OrderCompletionReportQueryVO orderCompletionReportQueryVO) { | |
78 | - | |
79 | - return ServerResult.success(); | |
80 | - } | |
81 | - | |
82 | - @Override | |
83 | - public ServerResult export(HttpServletResponse response, OrderBaseInfoQueryVO queryVO) throws IOException, Excel4JException { | |
84 | - LambdaQueryWrapper<OrderBaseInfoDO> queryWrapper = orderBaseInfoService.buildQueryByParam(queryVO); | |
85 | - List<OrderBaseInfoDO> orderBaseInfoDOList = orderBaseInfoService.list(queryWrapper); | |
86 | - if (CollectionUtils.isNotEmpty(orderBaseInfoDOList)) { | |
87 | - Map<Long, OrderBaseInfoDO> orderBaseInfoDOMap = new HashMap<>(); | |
88 | - Set<Long> orderIds = orderBaseInfoDOList.stream().map(OrderBaseInfoDO::getId).collect(Collectors.toSet()); | |
89 | - Set<String> innerNoSet = new HashSet<>(); | |
90 | - List<OrderCompletionReportDO> reportDOS = list(new LambdaQueryWrapper<OrderCompletionReportDO>().in(OrderCompletionReportDO::getOrderId, orderIds)); | |
91 | - Map<String, OrderReportAnalysisExportVo> exportVoMap = new HashMap<>(); | |
92 | - if (CollectionUtils.isNotEmpty(reportDOS)) { | |
93 | - OrderReportResultVO reportResultVO = filterBaseData(orderBaseInfoDOList, reportDOS); | |
94 | - orderBaseInfoDOList = reportResultVO.getOrderBaseInfoDOList(); | |
95 | - reportDOS = reportResultVO.getReportDOS(); | |
96 | - Map<Long, OrderCompletionReportDO> completionReportDOMap = new HashMap<>(); | |
97 | - completionReportDOMap = reportDOS.stream().collect(Collectors.toMap(OrderCompletionReportDO::getOrderId, Function.identity(), (x, y) -> x)); | |
98 | - for (OrderBaseInfoDO orderBaseInfoDO : orderBaseInfoDOList) { | |
99 | - if (completionReportDOMap.containsKey(orderBaseInfoDO.getId())) { | |
100 | - if (!innerNoSet.contains(orderBaseInfoDO.getInnerNo())) { | |
101 | - orderBaseInfoDOMap.put(orderBaseInfoDO.getId(), orderBaseInfoDO); | |
102 | - } | |
103 | - innerNoSet.add(orderBaseInfoDO.getInnerNo()); | |
104 | - } | |
105 | - } | |
106 | - for (OrderCompletionReportDO reportDO : reportDOS) { | |
107 | - handlerExportMap(reportDO, exportVoMap); | |
108 | - | |
109 | - } | |
110 | - } | |
111 | - List<OrderReportAnalysisExportVo> exportVos = exportMap2exportList(exportVoMap); | |
112 | - if (CollectionUtils.isNotEmpty(exportVos)) { | |
113 | - List<OrderReportStatExportVo> statExportVos = exportVos.stream().map(x -> { | |
114 | - OrderReportStatExportVo statExportVo = new OrderReportStatExportVo(); | |
115 | - statExportVo.setDesigner(x.getDesigner()); | |
116 | - statExportVo.setIdeaSourceRate(x.getIdeaSourceRate().divide(new BigDecimal(innerNoSet.size()), Constant.SIX, RoundingMode.HALF_UP).toString()); | |
117 | - statExportVo.setManualPreform1Rate(x.getManualPreform1Rate().divide(new BigDecimal(innerNoSet.size()), Constant.SIX, RoundingMode.HALF_UP).toString()); | |
118 | - statExportVo.setManualPreform2Rate(x.getManualPreform2Rate().divide(new BigDecimal(innerNoSet.size()), Constant.SIX, RoundingMode.HALF_UP).toString()); | |
119 | - return statExportVo; | |
120 | - }).collect(Collectors.toList()); | |
121 | - ExcelUtils.getInstance().exportObjects2Excel(statExportVos, OrderReportStatExportVo.class, response.getOutputStream()); | |
122 | - } | |
123 | - } | |
124 | - | |
125 | - return ServerResult.success(); | |
126 | - } | |
127 | - | |
128 | - /** | |
129 | - * @param exportVoMap | |
130 | - * @return | |
131 | - */ | |
132 | - private List<OrderReportAnalysisExportVo> exportMap2exportList(Map<String, OrderReportAnalysisExportVo> exportVoMap) { | |
133 | - List<OrderReportAnalysisExportVo> exportVos = new ArrayList<>(); | |
134 | - if (CollectionUtils.isEmpty(exportVoMap)) { | |
135 | - return exportVos; | |
136 | - } | |
137 | - for (Map.Entry<String, OrderReportAnalysisExportVo> exportVoEntry : exportVoMap.entrySet()) { | |
138 | - String key = exportVoEntry.getKey(); | |
139 | - OrderReportAnalysisExportVo exportVo = exportVoEntry.getValue(); | |
140 | - exportVo.setDesigner(key); | |
141 | - exportVos.add(exportVo); | |
142 | - } | |
143 | - return exportVos; | |
144 | - } | |
145 | - | |
146 | - /** | |
147 | - * @param reportDO | |
148 | - * @param exportVoMap | |
149 | - */ | |
150 | - private void handlerExportMap(OrderCompletionReportDO reportDO, Map<String, OrderReportAnalysisExportVo> exportVoMap) { | |
151 | - | |
152 | - String ideaSource = reportDO.getIdeaSource(); | |
153 | - String manualPreform1 = reportDO.getManualPreform1(); | |
154 | - String manualPreform2 = reportDO.getManualPreform2(); | |
155 | - OrderReportAnalysisExportVo ideaSource4exportVo = exportVoMap.get(ideaSource); | |
156 | - if (Objects.isNull(ideaSource4exportVo)) { | |
157 | - ideaSource4exportVo = new OrderReportAnalysisExportVo(); | |
158 | - ideaSource4exportVo.setIdeaSourceRate(new BigDecimal(0)); | |
159 | - ideaSource4exportVo.setManualPreform1Rate(new BigDecimal(0)); | |
160 | - ideaSource4exportVo.setManualPreform2Rate(new BigDecimal(0)); | |
161 | - } | |
162 | - ideaSource4exportVo.setIdeaSourceRate(new BigDecimal(Objects.nonNull(reportDO.getIdeaSourceRate()) ? reportDO.getIdeaSourceRate() : 0).add(ideaSource4exportVo.getIdeaSourceRate())); | |
163 | - exportVoMap.put(ideaSource, ideaSource4exportVo); | |
164 | - | |
165 | - OrderReportAnalysisExportVo manualPreform14exportVo = exportVoMap.get(manualPreform1); | |
166 | - if (Objects.isNull(manualPreform14exportVo)) { | |
167 | - manualPreform14exportVo = new OrderReportAnalysisExportVo(); | |
168 | - manualPreform14exportVo.setIdeaSourceRate(new BigDecimal(0)); | |
169 | - manualPreform14exportVo.setManualPreform1Rate(new BigDecimal(0)); | |
170 | - manualPreform14exportVo.setManualPreform2Rate(new BigDecimal(0)); | |
171 | - } | |
172 | - manualPreform14exportVo.setManualPreform1Rate(new BigDecimal(Objects.nonNull(reportDO.getManualPreform1Rate()) ? reportDO.getManualPreform1Rate() : 0).add(manualPreform14exportVo.getManualPreform1Rate())); | |
173 | - exportVoMap.put(manualPreform1, manualPreform14exportVo); | |
174 | - | |
175 | - OrderReportAnalysisExportVo manualPreform24exportVo = exportVoMap.get(manualPreform2); | |
176 | - if (Objects.isNull(manualPreform24exportVo)) { | |
177 | - manualPreform24exportVo = new OrderReportAnalysisExportVo(); | |
178 | - manualPreform24exportVo.setIdeaSourceRate(new BigDecimal(0)); | |
179 | - manualPreform24exportVo.setManualPreform1Rate(new BigDecimal(0)); | |
180 | - manualPreform24exportVo.setManualPreform2Rate(new BigDecimal(0)); | |
181 | - } | |
182 | - manualPreform24exportVo.setManualPreform2Rate(new BigDecimal(Objects.nonNull(reportDO.getManualPreform2Rate()) ? reportDO.getManualPreform2Rate() : 0).add(manualPreform24exportVo.getManualPreform2Rate())); | |
183 | - exportVoMap.put(manualPreform2, manualPreform24exportVo); | |
184 | - } | |
185 | - | |
186 | - @Override | |
187 | - public ServerResult analysis(OrderBaseInfoQueryVO queryVO) { | |
188 | - LambdaQueryWrapper<OrderBaseInfoDO> queryWrapper = orderBaseInfoService.buildQueryByParam(queryVO); | |
189 | - List<OrderBaseInfoDO> orderBaseInfoDOList = orderBaseInfoService.list(queryWrapper); | |
190 | - OrderReportAnalysisResultVo resultVo = new OrderReportAnalysisResultVo(); | |
191 | - Map<Long, OrderBaseInfoDO> orderBaseInfoDOMap = new HashMap<>(); | |
192 | - Set<String> innerNoSet = new HashSet<>(); | |
193 | - if (CollectionUtils.isNotEmpty(orderBaseInfoDOList)) { | |
194 | - | |
195 | - Set<Long> orderIds = orderBaseInfoDOList.stream().map(OrderBaseInfoDO::getId).collect(Collectors.toSet()); | |
196 | - List<OrderCompletionReportDO> reportDOS = list(new LambdaQueryWrapper<OrderCompletionReportDO>().in(OrderCompletionReportDO::getOrderId, orderIds)); | |
197 | - BigDecimal sum = new BigDecimal(0); | |
198 | - Map<Long, OrderCompletionReportDO> completionReportDOMap = new HashMap<>(); | |
199 | - if (CollectionUtils.isNotEmpty(reportDOS)) { | |
200 | - OrderReportResultVO reportResultVO = filterBaseData(orderBaseInfoDOList, reportDOS); | |
201 | - orderBaseInfoDOList = reportResultVO.getOrderBaseInfoDOList(); | |
202 | - reportDOS = reportResultVO.getReportDOS(); | |
203 | - completionReportDOMap = reportDOS.stream().collect(Collectors.toMap(OrderCompletionReportDO::getOrderId, Function.identity(), (x, y) -> x)); | |
204 | - for (OrderBaseInfoDO orderBaseInfoDO : orderBaseInfoDOList) { | |
205 | - if (completionReportDOMap.containsKey(orderBaseInfoDO.getId())) { | |
206 | - if (!innerNoSet.contains(orderBaseInfoDO.getInnerNo())) { | |
207 | - orderBaseInfoDOMap.put(orderBaseInfoDO.getId(), orderBaseInfoDO); | |
208 | - } | |
209 | - innerNoSet.add(orderBaseInfoDO.getInnerNo()); | |
210 | - } | |
211 | - } | |
212 | - for (OrderCompletionReportDO reportDO : reportDOS) { | |
213 | - Double ideaSourceRate = queryVO.getDesigner().equals(reportDO.getIdeaSource()) && Objects.nonNull(reportDO.getIdeaSourceRate()) ? reportDO.getIdeaSourceRate() : 0; | |
214 | - Double manualPreform1Rate = queryVO.getDesigner().equals(reportDO.getManualPreform1()) && Objects.nonNull(reportDO.getManualPreform1Rate()) ? reportDO.getManualPreform1Rate() : 0; | |
215 | - Double manualPreform2Rate = queryVO.getDesigner().equals(reportDO.getManualPreform2()) && Objects.nonNull(reportDO.getManualPreform2Rate()) ? reportDO.getManualPreform2Rate() : 0; | |
216 | - sum = sum.add(new BigDecimal(ideaSourceRate)).add(new BigDecimal(manualPreform1Rate)).add(new BigDecimal(manualPreform2Rate)); | |
217 | - } | |
218 | - } | |
219 | - resultVo.setRate(Double.parseDouble(sum.divide(new BigDecimal(innerNoSet.size()), Constant.SIX, RoundingMode.HALF_UP).toString())); | |
220 | - } | |
221 | - return ServerResult.success(resultVo); | |
222 | - } | |
223 | - | |
224 | - /** | |
225 | - * @param orderBaseInfoDOList | |
226 | - * @param reportDOS | |
227 | - * @return | |
228 | - */ | |
229 | - private OrderReportResultVO filterBaseData(List<OrderBaseInfoDO> orderBaseInfoDOList, List<OrderCompletionReportDO> reportDOS) { | |
230 | - OrderReportResultVO result = new OrderReportResultVO(); | |
231 | - List<OrderBaseInfoDO> result4orderBase = new ArrayList<>(); | |
232 | - List<OrderCompletionReportDO> result4report = new ArrayList<>(); | |
233 | - if (CollectionUtils.isEmpty(orderBaseInfoDOList)) { | |
234 | - return result; | |
235 | - } | |
236 | - Map<String, Long> innerOrderIdMap = new HashMap<>(); | |
237 | - Map<Long, OrderCompletionReportDO> reportDOMap = reportDOS.stream().collect(Collectors.toMap(OrderCompletionReportDO::getOrderId, Function.identity(), (x, y) -> x)); | |
238 | - for (OrderBaseInfoDO infoDO : orderBaseInfoDOList) { | |
239 | - if (reportDOMap.containsKey(infoDO.getId())) { | |
240 | - innerOrderIdMap.put(infoDO.getInnerNo(), infoDO.getId()); | |
241 | - } | |
242 | - } | |
243 | - List<Long> orderIds = new ArrayList<>(innerOrderIdMap.values()); | |
244 | - result4orderBase = orderBaseInfoDOList.stream().filter(x -> orderIds.contains(x.getId())).collect(Collectors.toList()); | |
245 | - result4report = reportDOS.stream().filter(x -> orderIds.contains(x.getOrderId())).collect(Collectors.toList()); | |
246 | - result.setOrderBaseInfoDOList(result4orderBase); | |
247 | - result.setReportDOS(result4report); | |
248 | - return result; | |
249 | - } | |
250 | - | |
251 | - /** | |
252 | - * 新增数据 | |
253 | - * | |
254 | - * @param orderCompletionReportVO 实例对象 | |
255 | - * @return 实例对象 | |
256 | - */ | |
257 | - @Override | |
258 | - public ServerResult add(OrderCompletionReportVO orderCompletionReportVO) { | |
259 | - //todo 校验 | |
260 | - if (Objects.nonNull(orderCompletionReportVO.getId())) { | |
261 | - orderCompletionReportVO.setId(null); | |
262 | - } | |
263 | - OrderCompletionReportDO orderCompletionReportDo = BeanUtil.copyProperties(orderCompletionReportVO, OrderCompletionReportDO.class); | |
264 | - | |
265 | - save(orderCompletionReportDo); | |
266 | - | |
267 | - return ServerResult.success(); | |
268 | - } | |
269 | - | |
270 | - /** | |
271 | - * 修改数据 | |
272 | - * | |
273 | - * @param orderCompletionReportVO 实例对象 | |
274 | - * @return 实例对象 | |
275 | - */ | |
276 | - @Override | |
277 | - public ServerResult edit(OrderCompletionReportVO orderCompletionReportVO) { | |
278 | - //todo 校验 | |
279 | - if (Objects.isNull(orderCompletionReportVO.getId())) { | |
280 | - return ServerResult.fail("id 不能为空"); | |
281 | - } | |
282 | - OrderCompletionReportDO orderCompletionReportDo = BeanUtil.copyProperties(orderCompletionReportVO, OrderCompletionReportDO.class); | |
283 | - | |
284 | - updateById(orderCompletionReportDo); | |
285 | - | |
286 | - return ServerResult.success(); | |
287 | - } | |
288 | - | |
289 | - /** | |
290 | - * 通过主键删除数据 | |
291 | - * | |
292 | - * @param orderCompletionReportQueryVO 筛选条件 | |
293 | - * @return 是否成功 | |
294 | - */ | |
295 | - @Override | |
296 | - public ServerResult deleteById(OrderCompletionReportQueryVO orderCompletionReportQueryVO) { | |
297 | - List<Long> ids = orderCompletionReportQueryVO.getIds(); | |
298 | - if (CollUtil.isEmpty(ids)) { | |
299 | - return ServerResult.fail("ids 参数不能为空"); | |
300 | - } | |
301 | - List<OrderCompletionReportDO> orderCompletionReportList = listByIds(ids); | |
302 | - if (CollUtil.isEmpty(orderCompletionReportList)) { | |
303 | - return ServerResult.success(); | |
304 | - } | |
305 | - //todo 校验是否可以逻辑删除 | |
306 | - LambdaUpdateWrapper<OrderCompletionReportDO> updateWrapper = new LambdaUpdateWrapper<OrderCompletionReportDO>() | |
307 | - .in(OrderCompletionReportDO::getId, ids) | |
308 | - .set(OrderCompletionReportDO::getEnableFlag, Constant.UNABLE_TWENTY); | |
309 | - update(updateWrapper); | |
310 | - return ServerResult.success(); | |
311 | - } | |
312 | - | |
313 | - /** | |
314 | - * 通过订单id逻辑删除 | |
315 | - * | |
316 | - * @param orderId | |
317 | - * @return | |
318 | - */ | |
319 | - @Override | |
320 | - public boolean deleteByOrderId(Long orderId) { | |
321 | - LambdaUpdateWrapper<OrderCompletionReportDO> updateWrapper = new LambdaUpdateWrapper<OrderCompletionReportDO>() | |
322 | - .eq(OrderCompletionReportDO::getOrderId, orderId) | |
323 | - .set(OrderCompletionReportDO::getEnableFlag, Constant.UNABLE_TWENTY); | |
324 | - | |
325 | - return update(updateWrapper); | |
326 | - } | |
327 | - | |
328 | - @Override | |
329 | - public boolean deleteByOrderIds(List<Long> orderIds) { | |
330 | - LambdaUpdateWrapper<OrderCompletionReportDO> updateWrapper = new LambdaUpdateWrapper<OrderCompletionReportDO>() | |
331 | - .in(OrderCompletionReportDO::getOrderId, orderIds) | |
332 | - .set(OrderCompletionReportDO::getEnableFlag, Constant.UNABLE_TWENTY); | |
333 | - | |
334 | - return update(updateWrapper); | |
335 | - } | |
336 | - | |
337 | - @Override | |
338 | - public long countByOrderStatus(Integer status) { | |
339 | - return baseMapper.selectCount(new LambdaQueryWrapper<OrderCompletionReportDO>() | |
340 | - .eq(OrderCompletionReportDO::getOrderStatus, status) | |
341 | - .eq(OrderCompletionReportDO::getEnableFlag, Constant.ENABLE_TEN)); | |
342 | - } | |
343 | - | |
344 | - @Override | |
345 | - public long countYearByOrderStatus(Integer status) { | |
346 | - return baseMapper.countYearByOrderStatus(status); | |
347 | - } | |
348 | -} |
src/main/java/com/order/erp/service/order/impl/OrderFieldLockApplyServiceImpl.java deleted
100644 → 0
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.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 | -import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; | |
10 | -import com.baomidou.mybatisplus.core.toolkit.StringUtils; | |
11 | -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | |
12 | -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | |
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.OrderFieldUtils; | |
18 | -import com.order.erp.config.DataScope; | |
19 | -import com.order.erp.domain.ApplyStatusEnum; | |
20 | -import com.order.erp.domain.ApplyTypeEnum; | |
21 | -import com.order.erp.domain.OrderStatusEnum; | |
22 | -import com.order.erp.domain.RoleEnum; | |
23 | -import com.order.erp.domain.dto.BaseDO; | |
24 | -import com.order.erp.domain.dto.order.*; | |
25 | -import com.order.erp.domain.vo.order.*; | |
26 | -import com.order.erp.mapper.order.OrderFieldLockApplyMapper; | |
27 | -import com.order.erp.service.order.*; | |
28 | -import lombok.extern.slf4j.Slf4j; | |
29 | -import org.springframework.beans.BeanUtils; | |
30 | -import org.springframework.stereotype.Service; | |
31 | -import org.springframework.transaction.annotation.Transactional; | |
32 | - | |
33 | -import javax.annotation.Resource; | |
34 | -import java.util.*; | |
35 | -import java.util.function.Function; | |
36 | -import java.util.stream.Collectors; | |
37 | - | |
38 | -/** | |
39 | - * 用户订单-字段锁定申请表(OrderFieldLockApply)表服务实现类 | |
40 | - * | |
41 | - * @author makejava | |
42 | - * @since 2023-09-08 15:26:45 | |
43 | - */ | |
44 | -@Slf4j | |
45 | -@Service | |
46 | -public class OrderFieldLockApplyServiceImpl extends ServiceImpl<OrderFieldLockApplyMapper, OrderFieldLockApplyDO> implements OrderFieldLockApplyService { | |
47 | - | |
48 | - @Resource | |
49 | - private DataScope dataScope; | |
50 | - | |
51 | - @Resource | |
52 | - private OrderFieldLockRecordService fieldLockRecordService; | |
53 | - | |
54 | - @Resource | |
55 | - private OrderFieldLockApplyService applyService; | |
56 | - | |
57 | - @Resource | |
58 | - private OrderAuditLogService auditLogService; | |
59 | - | |
60 | - @Resource | |
61 | - private OrderBaseInfoService orderBaseInfoService; | |
62 | - | |
63 | - @Resource | |
64 | - private OrderCompletionReportService reportService; | |
65 | - | |
66 | - @Resource | |
67 | - private OrderProfitAnalysisService profitAnalysisService; | |
68 | - | |
69 | - @Resource | |
70 | - private OrderTrackStageService trackStageService; | |
71 | - | |
72 | - @Resource | |
73 | - private OrderInspectionStageService inspectionStageService; | |
74 | - | |
75 | - /** | |
76 | - * 通过ID查询单条数据 | |
77 | - * <p> | |
78 | - * orderFieldLockApplyQueryVO 主键 | |
79 | - * | |
80 | - * @return 实例对象 | |
81 | - */ | |
82 | - @Override | |
83 | - public ServerResult queryById(OrderFieldLockApplyQueryVO orderFieldLockApplyQueryVO) { | |
84 | - if (Objects.isNull(orderFieldLockApplyQueryVO.getId())) { | |
85 | - return ServerResult.fail("id 不能为空"); | |
86 | - } | |
87 | - OrderFieldLockApplyDO OrderFieldLockApplyDo = getById(orderFieldLockApplyQueryVO.getId()); | |
88 | - if (Objects.isNull(OrderFieldLockApplyDo)) { | |
89 | - return ServerResult.success(null); | |
90 | - } | |
91 | - return ServerResult.success(BeanUtil.copyProperties(OrderFieldLockApplyDo, OrderFieldLockApplyVO.class)); | |
92 | - } | |
93 | - | |
94 | - /** | |
95 | - * 分页查询 | |
96 | - * | |
97 | - * @param orderFieldLockApplyQueryVO 筛选条件 | |
98 | - * @return 查询结果 | |
99 | - */ | |
100 | - @Override | |
101 | - public ServerResult list(OrderFieldLockApplyQueryVO orderFieldLockApplyQueryVO) { | |
102 | - return ServerResult.success(); | |
103 | - } | |
104 | - | |
105 | - @Override | |
106 | - public ServerResult listByPage(OrderFieldLockApplyQueryVO queryVO) { | |
107 | - LambdaQueryWrapper<OrderFieldLockApplyDO> queryWrapper = buildQueryByParam(queryVO); | |
108 | - Page page = new Page<>(queryVO.getPage(), queryVO.getPageSize()); | |
109 | - IPage<OrderFieldLockApplyDO> iPage = page(page, queryWrapper); | |
110 | - | |
111 | - Page<OrderApplyResultVO> webVOPage = new Page<>(); | |
112 | - List<OrderFieldLockApplyDO> applyDOList = iPage.getRecords(); | |
113 | - if (CollectionUtils.isNotEmpty(applyDOList)) { | |
114 | - List<OrderApplyResultVO> resultVOList = applyDOList.stream().map(x -> { | |
115 | - OrderApplyResultVO resultVO = new OrderApplyResultVO(); | |
116 | - BeanUtils.copyProperties(x, resultVO); | |
117 | - String fields = x.getFields(); | |
118 | - if (StringUtils.isNotBlank(fields)) { | |
119 | - if (ApplyTypeEnum.FIELD_EDIT_APPLY.getType() == x.getType()) { | |
120 | - resultVO.setFieldInfos(JSONObject.parseObject(fields, OrderLockFieldVO.class)); | |
121 | - } | |
122 | - if (ApplyTypeEnum.ORDER_REPORT_APPLY.getType() == x.getType()) { | |
123 | - OrderLockFieldVO fieldVO = new OrderLockFieldVO(); | |
124 | - fieldVO.setReportFields(JSONObject.parseObject(fields, OrderCompletionReportFieldVO.class)); | |
125 | - resultVO.setFieldInfos(fieldVO); | |
126 | - } | |
127 | - if (ApplyTypeEnum.ORDER_PROFIT_APPLY.getType() == x.getType()) { | |
128 | - OrderLockFieldVO fieldVO = new OrderLockFieldVO(); | |
129 | - fieldVO.setProfitAnalysisFields(JSONObject.parseObject(fields, OrderProfitAnalysisFieldVO.class)); | |
130 | - resultVO.setFieldInfos(fieldVO); | |
131 | - } | |
132 | - } | |
133 | - return resultVO; | |
134 | - }).collect(Collectors.toList()); | |
135 | - | |
136 | - fillOrderInfo(resultVOList); | |
137 | - webVOPage.setRecords(resultVOList); | |
138 | - } | |
139 | - BeanUtils.copyProperties(page, webVOPage, "records"); | |
140 | - return ServerResult.success(webVOPage); | |
141 | - } | |
142 | - | |
143 | - /** | |
144 | - * @param resultVOList | |
145 | - */ | |
146 | - private void fillOrderInfo(List<OrderApplyResultVO> resultVOList) { | |
147 | - if (CollectionUtils.isEmpty(resultVOList)) { | |
148 | - return; | |
149 | - } | |
150 | - Set<Long> orderIds = resultVOList.stream().map(OrderApplyResultVO::getOrderId).collect(Collectors.toSet()); | |
151 | - List<OrderBaseInfoDO> orderBaseInfoDOList = orderBaseInfoService.listByIds(orderIds); | |
152 | - | |
153 | - if (CollectionUtils.isNotEmpty(orderBaseInfoDOList)) { | |
154 | - fillOrderBaseInfo(resultVOList, orderBaseInfoDOList); | |
155 | - } | |
156 | - | |
157 | -// List<OrderCompletionReportDO> reportDOList = reportService.list(new LambdaQueryWrapper<OrderCompletionReportDO>() | |
158 | -// .eq(BaseDO::getEnableFlag, Constant.ENABLE_TEN).in(OrderCompletionReportDO::getOrderId, orderIds)); | |
159 | -// | |
160 | -// if (CollectionUtils.isNotEmpty(reportDOList)) { | |
161 | -// fillOrderReportInfo(resultVOList, reportDOList); | |
162 | -// } | |
163 | -// | |
164 | -// List<OrderProfitAnalysisDO> profitAnalysisDOList = profitAnalysisService.list(new LambdaQueryWrapper<OrderProfitAnalysisDO>() | |
165 | -// .eq(BaseDO::getEnableFlag, Constant.ENABLE_TEN).in(OrderProfitAnalysisDO::getOrderId, orderIds)); | |
166 | -// | |
167 | -// if (CollectionUtils.isNotEmpty(profitAnalysisDOList)) { | |
168 | -// fillOrderProfitInfo(resultVOList, profitAnalysisDOList); | |
169 | -// } | |
170 | -// | |
171 | -// List<OrderTrackStageDO> trackStageDOList = trackStageService.list(new LambdaQueryWrapper<OrderTrackStageDO>() | |
172 | -// .eq(BaseDO::getEnableFlag, Constant.ENABLE_TEN).in(OrderTrackStageDO::getOrderId, orderIds)); | |
173 | -// | |
174 | -// if (CollectionUtils.isNotEmpty(trackStageDOList)) { | |
175 | -// fillOrderTrackerInfo(resultVOList, trackStageDOList); | |
176 | -// } | |
177 | -// | |
178 | -// List<OrderInspectionStageDO> inspectionStageDOList = inspectionStageService.list(new LambdaQueryWrapper<OrderInspectionStageDO>() | |
179 | -// .eq(BaseDO::getEnableFlag, Constant.ENABLE_TEN).in(OrderInspectionStageDO::getOrderId, orderIds)); | |
180 | -// | |
181 | -// if (CollectionUtils.isNotEmpty(inspectionStageDOList)) { | |
182 | -// fillOrderInspectInfo(resultVOList, inspectionStageDOList); | |
183 | -// } | |
184 | - } | |
185 | - | |
186 | - /** | |
187 | - * @param resultVOList | |
188 | - * @param orderBaseInfoDOList | |
189 | - */ | |
190 | - private void fillOrderBaseInfo(List<OrderApplyResultVO> resultVOList, List<OrderBaseInfoDO> orderBaseInfoDOList) { | |
191 | - if (CollectionUtils.isEmpty(resultVOList)) { | |
192 | - return; | |
193 | - } | |
194 | - if (CollectionUtils.isEmpty(orderBaseInfoDOList)) { | |
195 | - return; | |
196 | - } | |
197 | - Map<Long, OrderBaseInfoDO> orderBaseInfoDOMap = orderBaseInfoDOList.stream().collect(Collectors.toMap(OrderBaseInfoDO::getId, Function.identity())); | |
198 | - resultVOList.forEach(x -> { | |
199 | - if (orderBaseInfoDOMap.containsKey(x.getOrderId())) { | |
200 | - OrderBaseInfoDO orderBaseInfoDO = orderBaseInfoDOMap.get(x.getOrderId()); | |
201 | - OrderBaseInfoVO orderBaseInfo = new OrderBaseInfoVO(); | |
202 | - BeanUtils.copyProperties(orderBaseInfoDO, orderBaseInfo); | |
203 | - x.setOrderBaseInfo(orderBaseInfo); | |
204 | - } | |
205 | - }); | |
206 | - } | |
207 | - | |
208 | - /** | |
209 | - * @param resultVOList | |
210 | - * @param reportDOList | |
211 | - */ | |
212 | - private void fillOrderReportInfo(List<OrderApplyResultVO> resultVOList, List<OrderCompletionReportDO> reportDOList) { | |
213 | - if (CollectionUtils.isEmpty(resultVOList)) { | |
214 | - return; | |
215 | - } | |
216 | - if (CollectionUtils.isEmpty(reportDOList)) { | |
217 | - return; | |
218 | - } | |
219 | - Map<Long, OrderCompletionReportDO> reportDOMap = reportDOList.stream().collect(Collectors.toMap(OrderCompletionReportDO::getId, Function.identity())); | |
220 | - resultVOList.forEach(x -> { | |
221 | - if (reportDOMap.containsKey(x.getOrderId())) { | |
222 | - OrderCompletionReportDO reportDO = reportDOMap.get(x.getOrderId()); | |
223 | - OrderCompletionReportVO reportVO = new OrderCompletionReportVO(); | |
224 | - BeanUtils.copyProperties(reportDO, reportVO); | |
225 | - x.setReportInfo(reportVO); | |
226 | - } | |
227 | - }); | |
228 | - } | |
229 | - | |
230 | - /** | |
231 | - * @param resultVOList | |
232 | - * @param profitAnalysisDOS | |
233 | - */ | |
234 | - private void fillOrderProfitInfo(List<OrderApplyResultVO> resultVOList, List<OrderProfitAnalysisDO> profitAnalysisDOS) { | |
235 | - if (CollectionUtils.isEmpty(resultVOList)) { | |
236 | - return; | |
237 | - } | |
238 | - if (CollectionUtils.isEmpty(profitAnalysisDOS)) { | |
239 | - return; | |
240 | - } | |
241 | - Map<Long, OrderProfitAnalysisDO> profitAnalysisDOMap = profitAnalysisDOS.stream().collect(Collectors.toMap(OrderProfitAnalysisDO::getId, Function.identity())); | |
242 | - resultVOList.forEach(x -> { | |
243 | - if (profitAnalysisDOMap.containsKey(x.getOrderId())) { | |
244 | - OrderProfitAnalysisDO profitAnalysisDO = profitAnalysisDOMap.get(x.getOrderId()); | |
245 | - OrderProfitAnalysisVO profitAnalysisVO = new OrderProfitAnalysisVO(); | |
246 | - BeanUtils.copyProperties(profitAnalysisDO, profitAnalysisVO); | |
247 | - x.setProfitAnalysisInfo(profitAnalysisVO); | |
248 | - } | |
249 | - }); | |
250 | - } | |
251 | - | |
252 | - /** | |
253 | - * @param resultVOList | |
254 | - * @param trackStageDOS | |
255 | - */ | |
256 | - private void fillOrderTrackerInfo(List<OrderApplyResultVO> resultVOList, List<OrderTrackStageDO> trackStageDOS) { | |
257 | - if (CollectionUtils.isEmpty(resultVOList)) { | |
258 | - return; | |
259 | - } | |
260 | - if (CollectionUtils.isEmpty(trackStageDOS)) { | |
261 | - return; | |
262 | - } | |
263 | - Map<Long, OrderTrackStageDO> trackStageDOMap = trackStageDOS.stream().collect(Collectors.toMap(OrderTrackStageDO::getId, Function.identity())); | |
264 | - resultVOList.forEach(x -> { | |
265 | - if (trackStageDOMap.containsKey(x.getOrderId())) { | |
266 | - OrderTrackStageDO trackStageDO = trackStageDOMap.get(x.getOrderId()); | |
267 | - OrderTrackStageVO trackStageVO = new OrderTrackStageVO(); | |
268 | - BeanUtils.copyProperties(trackStageDO, trackStageVO); | |
269 | - x.setTrackStageInfo(trackStageVO); | |
270 | - } | |
271 | - }); | |
272 | - } | |
273 | - | |
274 | - /** | |
275 | - * @param resultVOList | |
276 | - * @param inspectionStageDOS | |
277 | - */ | |
278 | - private void fillOrderInspectInfo(List<OrderApplyResultVO> resultVOList, List<OrderInspectionStageDO> inspectionStageDOS) { | |
279 | - if (CollectionUtils.isEmpty(resultVOList)) { | |
280 | - return; | |
281 | - } | |
282 | - if (CollectionUtils.isEmpty(inspectionStageDOS)) { | |
283 | - return; | |
284 | - } | |
285 | - Map<Long, OrderInspectionStageDO> inspectionStageDOMap = inspectionStageDOS.stream().collect(Collectors.toMap(OrderInspectionStageDO::getId, Function.identity())); | |
286 | - resultVOList.forEach(x -> { | |
287 | - if (inspectionStageDOMap.containsKey(x.getOrderId())) { | |
288 | - OrderInspectionStageDO inspectionStageDO = inspectionStageDOMap.get(x.getOrderId()); | |
289 | - OrderInspectionStageVO inspectionStageVO = new OrderInspectionStageVO(); | |
290 | - BeanUtils.copyProperties(inspectionStageDO, inspectionStageVO); | |
291 | - x.setInspectionStageInfo(inspectionStageVO); | |
292 | - } | |
293 | - }); | |
294 | - } | |
295 | - | |
296 | - /** | |
297 | - * @param queryVO | |
298 | - * @return | |
299 | - */ | |
300 | - private LambdaQueryWrapper<OrderFieldLockApplyDO> buildQueryByParam(OrderFieldLockApplyQueryVO queryVO) { | |
301 | - RoleEnum roleEnum = dataScope.getRole(); | |
302 | - RoleEnum roleSelect = null; | |
303 | - if (RoleEnum.BUSINESS_USER.getCode().equals(roleEnum.getCode())) { | |
304 | - queryVO.setBusinessPerson(dataScope.getLoginUserName()); | |
305 | - } | |
306 | - if (RoleEnum.ADMIN.getCode().equals(roleEnum.getCode())) { | |
307 | - if (Objects.nonNull(queryVO.getAuditType()) && 1 == queryVO.getAuditType()) { | |
308 | - roleEnum = RoleEnum.BUSINESS_USER; | |
309 | - } | |
310 | - if (Objects.nonNull(queryVO.getAuditType()) && 0 == queryVO.getAuditType()) { | |
311 | - roleSelect = RoleEnum.ADMIN; | |
312 | - } | |
313 | - } | |
314 | - Set<Long> orderIds = new HashSet<>(); | |
315 | - if (StringUtils.isNotBlank(queryVO.getBusinessPerson()) || CollectionUtils.isNotEmpty(queryVO.getCustomerCode()) || CollectionUtils.isNotEmpty(queryVO.getInnerNo()) | |
316 | - || CollectionUtils.isNotEmpty(queryVO.getProductionDepartment()) || CollectionUtils.isNotEmpty(queryVO.getProjectNo())) { | |
317 | - List<OrderBaseInfoDO> orderBaseInfoDOList = orderBaseInfoService.list(new LambdaQueryWrapper<OrderBaseInfoDO>() | |
318 | - .eq(StringUtils.isNotBlank(queryVO.getBusinessPerson()), OrderBaseInfoDO::getBusinessPerson, queryVO.getBusinessPerson()) | |
319 | - .eq(BaseDO::getEnableFlag, Constant.ENABLE_TEN) | |
320 | - .in(CollectionUtils.isNotEmpty(queryVO.getCustomerCode()), OrderBaseInfoDO::getCustomerCode, queryVO.getCustomerCode()) | |
321 | - .in(CollectionUtils.isNotEmpty(queryVO.getInnerNo()), OrderBaseInfoDO::getInnerNo, queryVO.getInnerNo()) | |
322 | - .in(CollectionUtils.isNotEmpty(queryVO.getProductionDepartment()), OrderBaseInfoDO::getProductionDepartment, queryVO.getProductionDepartment()) | |
323 | - .in(CollectionUtils.isNotEmpty(queryVO.getProjectNo()), OrderBaseInfoDO::getProjectNo, queryVO.getProjectNo())); | |
324 | - if (CollectionUtils.isNotEmpty(orderBaseInfoDOList)) { | |
325 | - orderIds = orderBaseInfoDOList.stream().map(OrderBaseInfoDO::getId).collect(Collectors.toSet()); | |
326 | - } else { | |
327 | - orderIds.add(-1L); | |
328 | - } | |
329 | - } | |
330 | - LambdaQueryWrapper<OrderFieldLockApplyDO> queryWrapper = new LambdaQueryWrapper<OrderFieldLockApplyDO>() | |
331 | - .eq(BaseDO::getEnableFlag, Constant.ENABLE_TEN) | |
332 | - .eq(Objects.nonNull(queryVO.getApplyUserId()), OrderFieldLockApplyDO::getApplyUserId, queryVO.getApplyUserId()) | |
333 | - .eq(Objects.nonNull(queryVO.getStatus()), OrderFieldLockApplyDO::getStatus, queryVO.getStatus()) | |
334 | - .eq(Objects.nonNull(queryVO.getType()), OrderFieldLockApplyDO::getType, queryVO.getType()) | |
335 | - .in(CollectionUtils.isNotEmpty(queryVO.getStatusList()), OrderFieldLockApplyDO::getStatus, queryVO.getStatusList()) | |
336 | - .in(CollectionUtils.isNotEmpty(orderIds), OrderFieldLockApplyDO::getOrderId, orderIds); | |
337 | - if (Objects.isNull(roleSelect)) { | |
338 | - queryWrapper.like(Objects.nonNull(roleEnum), OrderFieldLockApplyDO::getAuditRoleCodes, roleEnum.getCode()); | |
339 | - }else { | |
340 | - queryWrapper.eq(Objects.nonNull(roleSelect), OrderFieldLockApplyDO::getAuditRoleCodes, roleSelect.getCode()); | |
341 | - | |
342 | - } | |
343 | - return queryWrapper; | |
344 | - } | |
345 | - | |
346 | - /** | |
347 | - * 新增数据 | |
348 | - * | |
349 | - * @param orderFieldLockApplyVO 实例对象 | |
350 | - * @return 实例对象 | |
351 | - */ | |
352 | - @Override | |
353 | - public ServerResult add(OrderFieldLockApplyVO orderFieldLockApplyVO) { | |
354 | - //todo 校验 | |
355 | - if (Objects.nonNull(orderFieldLockApplyVO.getId())) { | |
356 | - orderFieldLockApplyVO.setId(null); | |
357 | - } | |
358 | - OrderFieldLockApplyDO orderFieldLockApplyDo = BeanUtil.copyProperties(orderFieldLockApplyVO, OrderFieldLockApplyDO.class); | |
359 | - | |
360 | - save(orderFieldLockApplyDo); | |
361 | - | |
362 | - return ServerResult.success(); | |
363 | - } | |
364 | - | |
365 | - @Override | |
366 | - public ServerResult doAudit(AuditVO auditVO) { | |
367 | - OrderFieldLockApplyDO applyDO = getById(auditVO.getId()); | |
368 | - if (Objects.isNull(applyDO)) { | |
369 | - throw new BusinessException(ServerResultCode.APPLY_NOT_EXIST); | |
370 | - } | |
371 | - Long auditUserId = dataScope.getLoginUserId(); | |
372 | - // 申请通过 | |
373 | - if (ApplyStatusEnum.AUDIT_PASS.getStatus().equals(auditVO.getStatus())) { | |
374 | - doPass(applyDO, auditUserId); | |
375 | - } | |
376 | - if (ApplyStatusEnum.AUDIT_REFUSE.getStatus().equals(auditVO.getStatus())) { | |
377 | - doRefuse(applyDO, auditUserId, auditVO.getRefuseRemark()); | |
378 | - } | |
379 | - return ServerResult.success(); | |
380 | - } | |
381 | - | |
382 | - @Transactional(rollbackFor = Exception.class) | |
383 | - public void doRefuse(OrderFieldLockApplyDO applyDO, Long auditUserId, String refuseRemark) { | |
384 | - applyDO.setAuditUserId(auditUserId); | |
385 | - applyDO.setStatus(ApplyStatusEnum.AUDIT_REFUSE.getStatus()); | |
386 | - applyDO.setRefuseRemark(refuseRemark); | |
387 | - OrderBaseInfoDO orderBaseInfoDO = orderBaseInfoService.getById(applyDO.getOrderId()); | |
388 | - if (Objects.isNull(orderBaseInfoDO)) { | |
389 | - throw new BusinessException(ServerResultCode.ORDER_BASE_INFO_EMPTY); | |
390 | - } | |
391 | - if (ApplyTypeEnum.ORDER_REPORT_APPLY.getType().equals(applyDO.getType())) { | |
392 | - | |
393 | - orderBaseInfoDO.setOrderStatus(OrderStatusEnum.REPORT_AUDIT_REFUSE.getStatus()); | |
394 | - orderBaseInfoService.updateById(orderBaseInfoDO); | |
395 | - } else if (ApplyTypeEnum.ORDER_PROFIT_APPLY.getType().equals(applyDO.getType())) { | |
396 | - orderBaseInfoDO.setOrderStatus(OrderStatusEnum.PROFIT_AUDIT_REFUSE.getStatus()); | |
397 | - orderBaseInfoService.updateById(orderBaseInfoDO); | |
398 | - } | |
399 | - OrderAuditLogDO auditLogDO = OrderAuditLogDO.builder().applyId(applyDO.getId()).orderId(applyDO.getOrderId()).optType(ApplyStatusEnum.AUDIT_REFUSE.getDesc()).build(); | |
400 | - | |
401 | - applyService.updateById(applyDO); | |
402 | - auditLogService.save(auditLogDO); | |
403 | - } | |
404 | - | |
405 | - /** | |
406 | - * @param applyDO | |
407 | - * @param auditUserId | |
408 | - */ | |
409 | - @Transactional(rollbackFor = Exception.class) | |
410 | - public void doPass(OrderFieldLockApplyDO applyDO, Long auditUserId) { | |
411 | - | |
412 | - if (ApplyTypeEnum.FIELD_EDIT_APPLY.getType().equals(applyDO.getType())) { | |
413 | - applyDO.setAuditUserId(auditUserId); | |
414 | - applyDO.setStatus(ApplyStatusEnum.AUDIT_PASS.getStatus()); | |
415 | - | |
416 | - OrderFieldLockRecordDO recordDO = fieldLockRecordService.getOne(new LambdaQueryWrapper<OrderFieldLockRecordDO>() | |
417 | - .eq(BaseDO::getEnableFlag, Constant.ENABLE_TEN) | |
418 | - .eq(OrderFieldLockRecordDO::getOrderId, applyDO.getOrderId()) | |
419 | - .eq(OrderFieldLockRecordDO::getUserId, applyDO.getApplyUserId()) | |
420 | - .orderByDesc(OrderFieldLockRecordDO::getId) | |
421 | - .last("limit 1")); | |
422 | - if (Objects.isNull(recordDO)) { | |
423 | - recordDO = OrderFieldLockRecordDO.builder() | |
424 | - .orderId(applyDO.getOrderId()) | |
425 | - .userId(applyDO.getApplyUserId()) | |
426 | - .fields(applyDO.getFields()).build(); | |
427 | - } | |
428 | - OrderLockFieldVO applyField = OrderFieldUtils.string2orderField(applyDO.getFields()); | |
429 | - OrderLockFieldVO recordField = StringUtils.isNotBlank(recordDO.getFields()) ? OrderFieldUtils.string2orderField(recordDO.getFields()) : null; | |
430 | - if (Objects.nonNull(recordDO)) { | |
431 | - if (applyDO.getAuditRoleCodes().contains(RoleEnum.BUSINESS_USER.getCode())) { | |
432 | - recordField.setBaseFields(applyField.getBaseFields()); | |
433 | - recordDO.setFields(JSONObject.toJSONString(recordField)); | |
434 | - } else { | |
435 | - recordField.setTrackStageFields(applyField.getTrackStageFields()); | |
436 | - recordField.setReportFields(applyField.getReportFields()); | |
437 | - recordField.setProfitAnalysisFields(applyField.getProfitAnalysisFields()); | |
438 | - recordField.setInspectionStageFields(applyField.getInspectionStageFields()); | |
439 | - recordDO.setFields(JSONObject.toJSONString(recordField)); | |
440 | - } | |
441 | - } else { | |
442 | - recordDO.setFields(applyDO.getFields()); | |
443 | - } | |
444 | - | |
445 | - | |
446 | - if (Objects.isNull(recordDO.getId())) { | |
447 | - fieldLockRecordService.save(recordDO); | |
448 | - } else { | |
449 | - fieldLockRecordService.updateById(recordDO); | |
450 | - } | |
451 | - } else if (ApplyTypeEnum.ORDER_REPORT_APPLY.getType().equals(applyDO.getType())) { | |
452 | - applyDO.setAuditUserId(auditUserId); | |
453 | - applyDO.setStatus(ApplyStatusEnum.AUDIT_PASS.getStatus()); | |
454 | - | |
455 | - OrderCompletionReportFieldVO reportFieldVO = JSONObject.parseObject(applyDO.getFields(), OrderCompletionReportFieldVO.class); | |
456 | - | |
457 | - OrderBaseInfoDO orderBaseInfoDO = orderBaseInfoService.getById(applyDO.getOrderId()); | |
458 | - if (Objects.isNull(orderBaseInfoDO)) { | |
459 | - throw new BusinessException(ServerResultCode.ORDER_BASE_INFO_EMPTY); | |
460 | - } | |
461 | - | |
462 | - OrderCompletionReportDO reportDO = reportService.getOne(new LambdaQueryWrapper<OrderCompletionReportDO>() | |
463 | - .eq(BaseDO::getEnableFlag, Constant.ENABLE_TEN) | |
464 | - .eq(OrderCompletionReportDO::getOrderId, applyDO.getOrderId())); | |
465 | - if (Objects.isNull(reportDO)) { | |
466 | - reportDO = reportField2reportDo(reportFieldVO); | |
467 | - reportDO.setOrderStatus(OrderStatusEnum.REPORT_AUDIT_PASS.getStatus()); | |
468 | - reportService.save(reportDO); | |
469 | - } else { | |
470 | - reportDO.setOrderStatus(OrderStatusEnum.REPORT_AUDIT_PASS.getStatus()); | |
471 | - reportDO.setIdeaSourceRate(Objects.nonNull(reportFieldVO.getIdeaSourceRate()) ? Double.valueOf(reportFieldVO.getIdeaSourceRate()) : null); | |
472 | - reportDO.setIdeaSource(reportFieldVO.getIdeaSource()); | |
473 | - reportDO.setManualPreform1(reportFieldVO.getManualPreform1()); | |
474 | - reportDO.setManualPreform1Rate(Objects.nonNull(reportFieldVO.getManualPreform1Rate()) ? Double.valueOf(reportFieldVO.getManualPreform1Rate()) : null); | |
475 | - reportDO.setManualPreform2(reportFieldVO.getManualPreform2()); | |
476 | - reportDO.setManualPreform2Rate(Objects.nonNull(reportFieldVO.getManualPreform2Rate()) ? Double.valueOf(reportFieldVO.getManualPreform2Rate()) : null); | |
477 | - reportService.updateById(reportDO); | |
478 | - } | |
479 | - orderBaseInfoDO.setOrderStatus(OrderStatusEnum.REPORT_AUDIT_PASS.getStatus()); | |
480 | - orderBaseInfoService.updateById(orderBaseInfoDO); | |
481 | - } else if (ApplyTypeEnum.ORDER_PROFIT_APPLY.getType().equals(applyDO.getType())) { | |
482 | - applyDO.setAuditUserId(auditUserId); | |
483 | - applyDO.setStatus(ApplyStatusEnum.AUDIT_PASS.getStatus()); | |
484 | - | |
485 | - OrderProfitAnalysisFieldVO profitAnalysisFieldVO = JSONObject.parseObject(applyDO.getFields(), OrderProfitAnalysisFieldVO.class); | |
486 | - | |
487 | - OrderBaseInfoDO orderBaseInfoDO = orderBaseInfoService.getById(applyDO.getOrderId()); | |
488 | - if (Objects.isNull(orderBaseInfoDO)) { | |
489 | - throw new BusinessException(ServerResultCode.ORDER_BASE_INFO_EMPTY); | |
490 | - } | |
491 | - | |
492 | - OrderProfitAnalysisDO profitAnalysisDO = profitAnalysisService.getOne(new LambdaQueryWrapper<OrderProfitAnalysisDO>() | |
493 | - .eq(BaseDO::getEnableFlag, Constant.ENABLE_TEN) | |
494 | - .eq(OrderProfitAnalysisDO::getOrderId, applyDO.getOrderId())); | |
495 | - if (Objects.isNull(profitAnalysisDO)) { | |
496 | - profitAnalysisDO = profitField2profitDo(profitAnalysisFieldVO); | |
497 | - profitAnalysisDO.setOrderStatus(OrderStatusEnum.PROFIT_AUDIT_PASS.getStatus()); | |
498 | - profitAnalysisService.save(profitAnalysisDO); | |
499 | - } else { | |
500 | - profitAnalysisDO.setOrderStatus(OrderStatusEnum.PROFIT_AUDIT_PASS.getStatus()); | |
501 | - profitAnalysisDO.setCustomerRmbPrice(Objects.nonNull(profitAnalysisFieldVO.getCustomerRmbPrice()) ? Double.valueOf(profitAnalysisFieldVO.getCustomerRmbPrice()) : null); | |
502 | - profitAnalysisDO.setCustomerRmbTotalPrice(Objects.nonNull(profitAnalysisFieldVO.getCustomerRmbTotalPrice()) ? Double.valueOf(profitAnalysisFieldVO.getCustomerRmbTotalPrice()) : null); | |
503 | - profitAnalysisDO.setCustomerPrice(Objects.nonNull(profitAnalysisFieldVO.getCustomerPrice()) ? Double.valueOf(profitAnalysisFieldVO.getCustomerPrice()) : null); | |
504 | - profitAnalysisDO.setCustomerTotalPrice(Objects.nonNull(profitAnalysisFieldVO.getCustomerTotalPrice()) ? Double.valueOf(profitAnalysisFieldVO.getCustomerTotalPrice()) : null); | |
505 | - profitAnalysisDO.setCustomerCurrency(StringUtils.isNotBlank(profitAnalysisFieldVO.getCustomerCurrency()) ? profitAnalysisFieldVO.getCustomerCurrency() : null); | |
506 | - profitAnalysisDO.setExchangeRate(Objects.nonNull(profitAnalysisFieldVO.getExchangeRate()) ? Double.valueOf(profitAnalysisFieldVO.getExchangeRate()) : null); | |
507 | - profitAnalysisDO.setPacketPrice(Objects.nonNull(profitAnalysisFieldVO.getPacketPrice()) ? Double.valueOf(profitAnalysisFieldVO.getPacketPrice()) : null); | |
508 | - profitAnalysisDO.setPacketCurrency(StringUtils.isNotBlank(profitAnalysisFieldVO.getPacketCurrency()) ? profitAnalysisFieldVO.getPacketCurrency() : null); | |
509 | - profitAnalysisDO.setPacketTotalPrice(Objects.nonNull(profitAnalysisFieldVO.getPacketTotalPrice()) ? Double.valueOf(profitAnalysisFieldVO.getPacketTotalPrice()) : null); | |
510 | - profitAnalysisDO.setProductionDepartmentPrice(Objects.nonNull(profitAnalysisFieldVO.getProductionDepartmentPrice()) ? Double.valueOf(profitAnalysisFieldVO.getProductionDepartmentPrice()) : null); | |
511 | - profitAnalysisDO.setProductionDepartmentTotalPrice(Objects.nonNull(profitAnalysisFieldVO.getProductionDepartmentTotalPrice()) ? Double.valueOf(profitAnalysisFieldVO.getProductionDepartmentTotalPrice()) : null); | |
512 | - profitAnalysisDO.setProductionDepartmentCurrency(StringUtils.isNotBlank(profitAnalysisFieldVO.getProductionDepartmentCurrency()) ? profitAnalysisFieldVO.getProductionDepartmentCurrency() : null); | |
513 | - profitAnalysisDO.setProfitRate(Objects.nonNull(profitAnalysisFieldVO.getProfitRate()) ? Double.valueOf(profitAnalysisFieldVO.getProfitRate()) : null); | |
514 | - profitAnalysisDO.setProfitType(StringUtils.isBlank(profitAnalysisFieldVO.getProfitType()) ? Constant.ZERO : Integer.parseInt(profitAnalysisFieldVO.getProfitType())); | |
515 | - profitAnalysisService.updateById(profitAnalysisDO); | |
516 | - } | |
517 | - orderBaseInfoDO.setOrderStatus(OrderStatusEnum.PROFIT_AUDIT_PASS.getStatus()); | |
518 | - orderBaseInfoService.updateById(orderBaseInfoDO); | |
519 | - } | |
520 | - | |
521 | - OrderAuditLogDO auditLogDO = OrderAuditLogDO.builder().applyId(applyDO.getId()).orderId(applyDO.getOrderId()).optType(ApplyStatusEnum.AUDIT_PASS.getDesc()).build(); | |
522 | - | |
523 | - applyService.updateById(applyDO); | |
524 | - | |
525 | - auditLogService.save(auditLogDO); | |
526 | - } | |
527 | - | |
528 | - /** | |
529 | - * @param reportFieldVO | |
530 | - * @return | |
531 | - */ | |
532 | - private OrderCompletionReportDO reportField2reportDo(OrderCompletionReportFieldVO reportFieldVO) { | |
533 | - return OrderCompletionReportDO.builder() | |
534 | - .ideaSourceRate(StringUtils.isNotBlank(reportFieldVO.getIdeaSourceRate()) ? Double.valueOf(reportFieldVO.getIdeaSourceRate()) : null) | |
535 | - .ideaSource(reportFieldVO.getIdeaSource()) | |
536 | - .manualPreform1(reportFieldVO.getManualPreform1()) | |
537 | - .manualPreform1Rate(StringUtils.isNotBlank(reportFieldVO.getManualPreform1Rate()) ? Double.valueOf(reportFieldVO.getManualPreform1Rate()) : null) | |
538 | - .manualPreform2(reportFieldVO.getManualPreform2()) | |
539 | - .manualPreform2Rate(StringUtils.isNotBlank(reportFieldVO.getManualPreform2Rate()) ? Double.valueOf(reportFieldVO.getManualPreform2Rate()) : null) | |
540 | - .orderId(reportFieldVO.getOrderId()) | |
541 | - .build(); | |
542 | - } | |
543 | - | |
544 | - /** | |
545 | - * @param profitAnalysisFieldVO | |
546 | - * @return | |
547 | - */ | |
548 | - private OrderProfitAnalysisDO profitField2profitDo(OrderProfitAnalysisFieldVO profitAnalysisFieldVO) { | |
549 | - return OrderProfitAnalysisDO.builder() | |
550 | - .orderId(profitAnalysisFieldVO.getOrderId()) | |
551 | - .profitType(StringUtils.isBlank(profitAnalysisFieldVO.getProfitType()) ? Constant.ZERO : Integer.parseInt(profitAnalysisFieldVO.getProfitType())) | |
552 | - .customerRmbPrice(Objects.nonNull(profitAnalysisFieldVO.getCustomerRmbPrice()) ? Double.valueOf(profitAnalysisFieldVO.getCustomerRmbPrice()) : null) | |
553 | - .customerRmbTotalPrice(Objects.nonNull(profitAnalysisFieldVO.getCustomerRmbTotalPrice()) ? Double.valueOf(profitAnalysisFieldVO.getCustomerRmbTotalPrice()) : null) | |
554 | - .customerPrice(Objects.nonNull(profitAnalysisFieldVO.getCustomerPrice()) ? Double.valueOf(profitAnalysisFieldVO.getCustomerPrice()) : null) | |
555 | - .customerTotalPrice(Objects.nonNull(profitAnalysisFieldVO.getCustomerTotalPrice()) ? Double.valueOf(profitAnalysisFieldVO.getCustomerTotalPrice()) : null) | |
556 | - .customerCurrency(StringUtils.isNotBlank(profitAnalysisFieldVO.getCustomerCurrency()) ? profitAnalysisFieldVO.getCustomerCurrency() : null) | |
557 | - .exchangeRate(Objects.nonNull(profitAnalysisFieldVO.getExchangeRate()) ? Double.valueOf(profitAnalysisFieldVO.getExchangeRate()) : null) | |
558 | - .packetPrice(Objects.nonNull(profitAnalysisFieldVO.getPacketPrice()) ? Double.valueOf(profitAnalysisFieldVO.getPacketPrice()) : null) | |
559 | - .packetTotalPrice(Objects.nonNull(profitAnalysisFieldVO.getPacketTotalPrice()) ? Double.valueOf(profitAnalysisFieldVO.getPacketTotalPrice()) : null) | |
560 | - .packetCurrency(StringUtils.isNotBlank(profitAnalysisFieldVO.getPacketCurrency()) ? profitAnalysisFieldVO.getPacketCurrency() : null) | |
561 | - .productionDepartmentPrice(Objects.nonNull(profitAnalysisFieldVO.getProductionDepartmentPrice()) ? Double.valueOf(profitAnalysisFieldVO.getProductionDepartmentPrice()) : null) | |
562 | - .productionDepartmentTotalPrice(Objects.nonNull(profitAnalysisFieldVO.getProductionDepartmentTotalPrice()) ? Double.valueOf(profitAnalysisFieldVO.getProductionDepartmentTotalPrice()) : null) | |
563 | - .productionDepartmentCurrency(StringUtils.isNotBlank(profitAnalysisFieldVO.getProductionDepartmentCurrency()) ? profitAnalysisFieldVO.getProductionDepartmentCurrency() : null) | |
564 | - .profitRate(Objects.nonNull(profitAnalysisFieldVO.getProfitRate()) ? Double.valueOf(profitAnalysisFieldVO.getProfitRate()) : null) | |
565 | - .build(); | |
566 | - } | |
567 | - | |
568 | - /** | |
569 | - * 修改数据 | |
570 | - * | |
571 | - * @param orderFieldLockApplyVO 实例对象 | |
572 | - * @return 实例对象 | |
573 | - */ | |
574 | - @Override | |
575 | - public ServerResult edit(OrderFieldLockApplyVO orderFieldLockApplyVO) { | |
576 | - //todo 校验 | |
577 | - if (Objects.isNull(orderFieldLockApplyVO.getId())) { | |
578 | - return ServerResult.fail("id 不能为空"); | |
579 | - } | |
580 | - OrderFieldLockApplyDO orderFieldLockApplyDo = BeanUtil.copyProperties(orderFieldLockApplyVO, OrderFieldLockApplyDO.class); | |
581 | - | |
582 | - updateById(orderFieldLockApplyDo); | |
583 | - | |
584 | - return ServerResult.success(); | |
585 | - } | |
586 | - | |
587 | - /** | |
588 | - * 通过主键删除数据 | |
589 | - * | |
590 | - * @param orderFieldLockApplyQueryVO 筛选条件 | |
591 | - * @return 是否成功 | |
592 | - */ | |
593 | - @Override | |
594 | - public ServerResult deleteById(OrderFieldLockApplyQueryVO orderFieldLockApplyQueryVO) { | |
595 | - List<Long> ids = orderFieldLockApplyQueryVO.getIds(); | |
596 | - if (CollUtil.isEmpty(ids)) { | |
597 | - return ServerResult.fail("ids 参数不能为空"); | |
598 | - } | |
599 | - List<OrderFieldLockApplyDO> orderFieldLockApplyList = listByIds(ids); | |
600 | - if (CollUtil.isEmpty(orderFieldLockApplyList)) { | |
601 | - return ServerResult.success(); | |
602 | - } | |
603 | - //todo 校验是否可以逻辑删除 | |
604 | - LambdaUpdateWrapper<OrderFieldLockApplyDO> updateWrapper = new LambdaUpdateWrapper<OrderFieldLockApplyDO>() | |
605 | - .in(OrderFieldLockApplyDO::getId, ids) | |
606 | - .set(OrderFieldLockApplyDO::getEnableFlag, Constant.UNABLE_TWENTY); | |
607 | - update(updateWrapper); | |
608 | - return ServerResult.success(); | |
609 | - } | |
610 | - | |
611 | - /** | |
612 | - * 通过订单id逻辑删除 | |
613 | - * | |
614 | - * @param orderId | |
615 | - * @return | |
616 | - */ | |
617 | - @Override | |
618 | - public boolean deleteByOrderId(Long orderId) { | |
619 | - LambdaUpdateWrapper<OrderFieldLockApplyDO> updateWrapper = new LambdaUpdateWrapper<OrderFieldLockApplyDO>() | |
620 | - .in(OrderFieldLockApplyDO::getOrderId, orderId) | |
621 | - .set(OrderFieldLockApplyDO::getEnableFlag, Constant.UNABLE_TWENTY); | |
622 | - | |
623 | - return update(updateWrapper); | |
624 | - } | |
625 | - | |
626 | - @Override | |
627 | - public boolean deleteByOrderIds(List<Long> orderIds) { | |
628 | - LambdaUpdateWrapper<OrderFieldLockApplyDO> updateWrapper = new LambdaUpdateWrapper<OrderFieldLockApplyDO>() | |
629 | - .in(OrderFieldLockApplyDO::getOrderId, orderIds) | |
630 | - .set(OrderFieldLockApplyDO::getEnableFlag, Constant.UNABLE_TWENTY); | |
631 | - | |
632 | - return update(updateWrapper); | |
633 | - } | |
634 | -} |
src/main/java/com/order/erp/service/order/impl/OrderFieldLockRecordServiceImpl.java deleted
100644 → 0
1 | -package com.order.erp.service.order.impl; | |
2 | - | |
3 | -import cn.hutool.core.bean.BeanUtil; | |
4 | -import cn.hutool.core.collection.CollUtil; | |
5 | -import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; | |
6 | -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | |
7 | -import com.order.erp.common.constant.Constant; | |
8 | -import com.order.erp.common.constant.ServerResult; | |
9 | -import com.order.erp.domain.dto.order.OrderFieldLockRecordDO; | |
10 | -import com.order.erp.domain.vo.order.OrderFieldLockRecordQueryVO; | |
11 | -import com.order.erp.domain.vo.order.OrderFieldLockRecordVO; | |
12 | -import com.order.erp.mapper.order.OrderFieldLockRecordMapper; | |
13 | -import com.order.erp.service.order.OrderFieldLockRecordService; | |
14 | -import lombok.extern.slf4j.Slf4j; | |
15 | -import org.springframework.stereotype.Service; | |
16 | - | |
17 | -import java.util.List; | |
18 | -import java.util.Objects; | |
19 | - | |
20 | -/** | |
21 | - * 用户订单-字段锁定记录表(OrderFieldLockRecord)表服务实现类 | |
22 | - * | |
23 | - * @author makejava | |
24 | - * @since 2023-09-08 15:26:45 | |
25 | - */ | |
26 | -@Slf4j | |
27 | -@Service | |
28 | -public class OrderFieldLockRecordServiceImpl extends ServiceImpl<OrderFieldLockRecordMapper, OrderFieldLockRecordDO> implements OrderFieldLockRecordService { | |
29 | - | |
30 | - | |
31 | - /** | |
32 | - * 通过ID查询单条数据 | |
33 | - * <p> | |
34 | - * orderFieldLockRecordQueryVO 主键 | |
35 | - * | |
36 | - * @return 实例对象 | |
37 | - */ | |
38 | - @Override | |
39 | - public ServerResult queryById(OrderFieldLockRecordQueryVO orderFieldLockRecordQueryVO) { | |
40 | - if (Objects.isNull(orderFieldLockRecordQueryVO.getId())) { | |
41 | - return ServerResult.fail("id 不能为空"); | |
42 | - } | |
43 | - OrderFieldLockRecordDO OrderFieldLockRecordDo = getById(orderFieldLockRecordQueryVO.getId()); | |
44 | - if (Objects.isNull(OrderFieldLockRecordDo)) { | |
45 | - return ServerResult.success(null); | |
46 | - } | |
47 | - return ServerResult.success(BeanUtil.copyProperties(OrderFieldLockRecordDo, OrderFieldLockRecordVO.class)); | |
48 | - } | |
49 | - | |
50 | - /** | |
51 | - * 分页查询 | |
52 | - * | |
53 | - * @param orderFieldLockRecordQueryVO 筛选条件 | |
54 | - * @return 查询结果 | |
55 | - */ | |
56 | - @Override | |
57 | - public ServerResult list(OrderFieldLockRecordQueryVO orderFieldLockRecordQueryVO) { | |
58 | - | |
59 | - return ServerResult.success(); | |
60 | - } | |
61 | - | |
62 | - /** | |
63 | - * 新增数据 | |
64 | - * | |
65 | - * @param orderFieldLockRecordVO 实例对象 | |
66 | - * @return 实例对象 | |
67 | - */ | |
68 | - @Override | |
69 | - public ServerResult add(OrderFieldLockRecordVO orderFieldLockRecordVO) { | |
70 | - //todo 校验 | |
71 | - if (Objects.nonNull(orderFieldLockRecordVO.getId())) { | |
72 | - orderFieldLockRecordVO.setId(null); | |
73 | - } | |
74 | - OrderFieldLockRecordDO orderFieldLockRecordDo = BeanUtil.copyProperties(orderFieldLockRecordVO, OrderFieldLockRecordDO.class); | |
75 | - | |
76 | - save(orderFieldLockRecordDo); | |
77 | - | |
78 | - return ServerResult.success(); | |
79 | - } | |
80 | - | |
81 | - /** | |
82 | - * 修改数据 | |
83 | - * | |
84 | - * @param orderFieldLockRecordVO 实例对象 | |
85 | - * @return 实例对象 | |
86 | - */ | |
87 | - @Override | |
88 | - public ServerResult edit(OrderFieldLockRecordVO orderFieldLockRecordVO) { | |
89 | - //todo 校验 | |
90 | - if (Objects.isNull(orderFieldLockRecordVO.getId())) { | |
91 | - return ServerResult.fail("id 不能为空"); | |
92 | - } | |
93 | - OrderFieldLockRecordDO orderFieldLockRecordDo = BeanUtil.copyProperties(orderFieldLockRecordVO, OrderFieldLockRecordDO.class); | |
94 | - | |
95 | - updateById(orderFieldLockRecordDo); | |
96 | - | |
97 | - return ServerResult.success(); | |
98 | - } | |
99 | - | |
100 | - /** | |
101 | - * 通过主键删除数据 | |
102 | - * | |
103 | - * @param orderFieldLockRecordQueryVO 筛选条件 | |
104 | - * @return 是否成功 | |
105 | - */ | |
106 | - @Override | |
107 | - public ServerResult deleteById(OrderFieldLockRecordQueryVO orderFieldLockRecordQueryVO) { | |
108 | - List<Long> ids = orderFieldLockRecordQueryVO.getIds(); | |
109 | - if (CollUtil.isEmpty(ids)) { | |
110 | - return ServerResult.fail("ids 参数不能为空"); | |
111 | - } | |
112 | - List<OrderFieldLockRecordDO> orderFieldLockRecordList = listByIds(ids); | |
113 | - if (CollUtil.isEmpty(orderFieldLockRecordList)) { | |
114 | - return ServerResult.success(); | |
115 | - } | |
116 | - //todo 校验是否可以逻辑删除 | |
117 | - LambdaUpdateWrapper<OrderFieldLockRecordDO> updateWrapper = new LambdaUpdateWrapper<OrderFieldLockRecordDO>() | |
118 | - .in(OrderFieldLockRecordDO::getId, ids) | |
119 | - .set(OrderFieldLockRecordDO::getEnableFlag, Constant.UNABLE_TWENTY); | |
120 | - update(updateWrapper); | |
121 | - return ServerResult.success(); | |
122 | - } | |
123 | - | |
124 | - /** | |
125 | - * 通过订单id逻辑删除 | |
126 | - * @param orderId | |
127 | - * @return | |
128 | - */ | |
129 | - @Override | |
130 | - public boolean deleteByOrderId(Long orderId) { | |
131 | - LambdaUpdateWrapper<OrderFieldLockRecordDO> updateWrapper = new LambdaUpdateWrapper<OrderFieldLockRecordDO>() | |
132 | - .eq(OrderFieldLockRecordDO::getOrderId, orderId) | |
133 | - .set(OrderFieldLockRecordDO::getEnableFlag, Constant.UNABLE_TWENTY); | |
134 | - | |
135 | - return update(updateWrapper); | |
136 | - } | |
137 | - | |
138 | - @Override | |
139 | - public boolean deleteByOrderIds(List<Long> orderIds) { | |
140 | - LambdaUpdateWrapper<OrderFieldLockRecordDO> updateWrapper = new LambdaUpdateWrapper<OrderFieldLockRecordDO>() | |
141 | - .in(OrderFieldLockRecordDO::getOrderId, orderIds) | |
142 | - .set(OrderFieldLockRecordDO::getEnableFlag, Constant.UNABLE_TWENTY); | |
143 | - | |
144 | - return update(updateWrapper); | |
145 | - } | |
146 | -} |
src/main/java/com/order/erp/service/order/impl/OrderInspectionStageServiceImpl.java deleted
100644 → 0
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.extension.service.impl.ServiceImpl; | |
8 | -import com.order.erp.common.constant.Constant; | |
9 | -import com.order.erp.common.constant.ServerResult; | |
10 | -import com.order.erp.domain.OrderStatusEnum; | |
11 | -import com.order.erp.domain.dto.order.OrderBaseInfoDO; | |
12 | -import com.order.erp.domain.dto.order.OrderInspectionStageDO; | |
13 | -import com.order.erp.domain.vo.order.OrderInspectionStageQueryVO; | |
14 | -import com.order.erp.domain.vo.order.OrderInspectionStageVO; | |
15 | -import com.order.erp.mapper.order.OrderInspectionStageMapper; | |
16 | -import com.order.erp.service.order.OrderInspectionStageService; | |
17 | -import lombok.extern.slf4j.Slf4j; | |
18 | -import org.springframework.stereotype.Service; | |
19 | - | |
20 | -import java.util.List; | |
21 | -import java.util.Objects; | |
22 | - | |
23 | -/** | |
24 | - * 订单-质检环节(OrderInspectionStage)表服务实现类 | |
25 | - * | |
26 | - * @author makejava | |
27 | - * @since 2023-09-08 15:26:46 | |
28 | - */ | |
29 | -@Slf4j | |
30 | -@Service | |
31 | -public class OrderInspectionStageServiceImpl extends ServiceImpl<OrderInspectionStageMapper, OrderInspectionStageDO> implements OrderInspectionStageService { | |
32 | - | |
33 | - | |
34 | - /** | |
35 | - * 通过ID查询单条数据 | |
36 | - * <p> | |
37 | - * orderInspectionStageQueryVO 主键 | |
38 | - * | |
39 | - * @return 实例对象 | |
40 | - */ | |
41 | - @Override | |
42 | - public ServerResult queryById(OrderInspectionStageQueryVO orderInspectionStageQueryVO) { | |
43 | - if (Objects.isNull(orderInspectionStageQueryVO.getId())) { | |
44 | - return ServerResult.fail("id 不能为空"); | |
45 | - } | |
46 | - OrderInspectionStageDO OrderInspectionStageDo = getById(orderInspectionStageQueryVO.getId()); | |
47 | - if (Objects.isNull(OrderInspectionStageDo)) { | |
48 | - return ServerResult.success(null); | |
49 | - } | |
50 | - return ServerResult.success(BeanUtil.copyProperties(OrderInspectionStageDo, OrderInspectionStageVO.class)); | |
51 | - } | |
52 | - | |
53 | - /** | |
54 | - * 分页查询 | |
55 | - * | |
56 | - * @param orderInspectionStageQueryVO 筛选条件 | |
57 | - * @return 查询结果 | |
58 | - */ | |
59 | - @Override | |
60 | - public ServerResult list(OrderInspectionStageQueryVO orderInspectionStageQueryVO) { | |
61 | - | |
62 | - return ServerResult.success(); | |
63 | - } | |
64 | - | |
65 | - /** | |
66 | - * 新增数据 | |
67 | - * | |
68 | - * @param orderInspectionStageVO 实例对象 | |
69 | - * @return 实例对象 | |
70 | - */ | |
71 | - @Override | |
72 | - public ServerResult add(OrderInspectionStageVO orderInspectionStageVO) { | |
73 | - //todo 校验 | |
74 | - if (Objects.nonNull(orderInspectionStageVO.getId())) { | |
75 | - orderInspectionStageVO.setId(null); | |
76 | - } | |
77 | - OrderInspectionStageDO orderInspectionStageDo = BeanUtil.copyProperties(orderInspectionStageVO, OrderInspectionStageDO.class); | |
78 | - | |
79 | - save(orderInspectionStageDo); | |
80 | - | |
81 | - return ServerResult.success(); | |
82 | - } | |
83 | - | |
84 | - /** | |
85 | - * 修改数据 | |
86 | - * | |
87 | - * @param orderInspectionStageVO 实例对象 | |
88 | - * @return 实例对象 | |
89 | - */ | |
90 | - @Override | |
91 | - public ServerResult edit(OrderInspectionStageVO orderInspectionStageVO) { | |
92 | - //todo 校验 | |
93 | - if (Objects.isNull(orderInspectionStageVO.getId())) { | |
94 | - return ServerResult.fail("id 不能为空"); | |
95 | - } | |
96 | - OrderInspectionStageDO orderInspectionStageDo = BeanUtil.copyProperties(orderInspectionStageVO, OrderInspectionStageDO.class); | |
97 | - | |
98 | - updateById(orderInspectionStageDo); | |
99 | - | |
100 | - return ServerResult.success(); | |
101 | - } | |
102 | - | |
103 | - /** | |
104 | - * 通过主键删除数据 | |
105 | - * | |
106 | - * @param orderInspectionStageQueryVO 筛选条件 | |
107 | - * @return 是否成功 | |
108 | - */ | |
109 | - @Override | |
110 | - public ServerResult deleteById(OrderInspectionStageQueryVO orderInspectionStageQueryVO) { | |
111 | - List<Long> ids = orderInspectionStageQueryVO.getIds(); | |
112 | - if (CollUtil.isEmpty(ids)) { | |
113 | - return ServerResult.fail("ids 参数不能为空"); | |
114 | - } | |
115 | - List<OrderInspectionStageDO> orderInspectionStageList = listByIds(ids); | |
116 | - if (CollUtil.isEmpty(orderInspectionStageList)) { | |
117 | - return ServerResult.success(); | |
118 | - } | |
119 | - //todo 校验是否可以逻辑删除 | |
120 | - LambdaUpdateWrapper<OrderInspectionStageDO> updateWrapper = new LambdaUpdateWrapper<OrderInspectionStageDO>() | |
121 | - .in(OrderInspectionStageDO::getId, ids) | |
122 | - .set(OrderInspectionStageDO::getEnableFlag, Constant.UNABLE_TWENTY); | |
123 | - update(updateWrapper); | |
124 | - return ServerResult.success(); | |
125 | - } | |
126 | - | |
127 | - @Override | |
128 | - public boolean deleteByOrderId(Long orderId) { | |
129 | - LambdaUpdateWrapper<OrderInspectionStageDO> updateWrapper = new LambdaUpdateWrapper<OrderInspectionStageDO>() | |
130 | - .eq(OrderInspectionStageDO::getOrderId, orderId) | |
131 | - .set(OrderInspectionStageDO::getEnableFlag, Constant.UNABLE_TWENTY); | |
132 | - return update(updateWrapper); | |
133 | - } | |
134 | - | |
135 | - @Override | |
136 | - public boolean deleteByOrderIds(List<Long> orderIds) { | |
137 | - LambdaUpdateWrapper<OrderInspectionStageDO> updateWrapper = new LambdaUpdateWrapper<OrderInspectionStageDO>() | |
138 | - .in(OrderInspectionStageDO::getOrderId, orderIds) | |
139 | - .set(OrderInspectionStageDO::getEnableFlag, Constant.UNABLE_TWENTY); | |
140 | - return update(updateWrapper); | |
141 | - } | |
142 | - | |
143 | - @Override | |
144 | - public long countByOrderStatus(Integer orderStatus) { | |
145 | - return this.count(new LambdaQueryWrapper<OrderInspectionStageDO>().eq(OrderInspectionStageDO::getOrderStatus,orderStatus) | |
146 | - .eq(OrderInspectionStageDO::getEnableFlag,Constant.ENABLE_TEN)); | |
147 | - } | |
148 | - | |
149 | - @Override | |
150 | - public long countRecentMonthByOrderStatus(Integer status) { | |
151 | - return this.baseMapper.countRecentMonthByOrderStatus(status); | |
152 | - } | |
153 | -} |
src/main/java/com/order/erp/service/order/impl/OrderOptLogServiceImpl.java deleted
100644 → 0
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.core.toolkit.CollectionUtils; | |
9 | -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | |
10 | -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | |
11 | -import com.order.erp.common.constant.Constant; | |
12 | -import com.order.erp.common.constant.ServerResult; | |
13 | -import com.order.erp.domain.dto.BaseDO; | |
14 | -import com.order.erp.domain.dto.admin.AdminUserDO; | |
15 | -import com.order.erp.domain.dto.order.OrderOptLogDO; | |
16 | -import com.order.erp.domain.vo.order.OrderOptLogQueryVO; | |
17 | -import com.order.erp.domain.vo.order.OrderOptLogResultVO; | |
18 | -import com.order.erp.domain.vo.order.OrderOptLogVO; | |
19 | -import com.order.erp.mapper.order.OrderOptLogMapper; | |
20 | -import com.order.erp.service.admin.AdminUserService; | |
21 | -import com.order.erp.service.order.OrderOptLogService; | |
22 | -import lombok.extern.slf4j.Slf4j; | |
23 | -import org.springframework.beans.BeanUtils; | |
24 | -import org.springframework.stereotype.Service; | |
25 | - | |
26 | -import javax.annotation.Resource; | |
27 | -import java.util.*; | |
28 | -import java.util.function.Function; | |
29 | -import java.util.stream.Collectors; | |
30 | - | |
31 | -/** | |
32 | - * 用户订单操作日志表(OrderOptLog)表服务实现类 | |
33 | - * | |
34 | - * @author makejava | |
35 | - * @since 2023-09-08 15:26:47 | |
36 | - */ | |
37 | -@Slf4j | |
38 | -@Service | |
39 | -public class OrderOptLogServiceImpl extends ServiceImpl<OrderOptLogMapper, OrderOptLogDO> implements OrderOptLogService { | |
40 | - | |
41 | - | |
42 | - @Resource | |
43 | - private AdminUserService userService; | |
44 | - | |
45 | - /** | |
46 | - * 通过ID查询单条数据 | |
47 | - * <p> | |
48 | - * orderOptLogQueryVO 主键 | |
49 | - * | |
50 | - * @return 实例对象 | |
51 | - */ | |
52 | - @Override | |
53 | - public ServerResult queryById(OrderOptLogQueryVO orderOptLogQueryVO) { | |
54 | - if (Objects.isNull(orderOptLogQueryVO.getId())) { | |
55 | - return ServerResult.fail("id 不能为空"); | |
56 | - } | |
57 | - OrderOptLogDO OrderOptLogDo = getById(orderOptLogQueryVO.getId()); | |
58 | - if (Objects.isNull(OrderOptLogDo)) { | |
59 | - return ServerResult.success(null); | |
60 | - } | |
61 | - return ServerResult.success(BeanUtil.copyProperties(OrderOptLogDo, OrderOptLogVO.class)); | |
62 | - } | |
63 | - | |
64 | - /** | |
65 | - * 分页查询 | |
66 | - * | |
67 | - * @param orderOptLogQueryVO 筛选条件 | |
68 | - * @return 查询结果 | |
69 | - */ | |
70 | - @Override | |
71 | - public ServerResult list(OrderOptLogQueryVO orderOptLogQueryVO) { | |
72 | - | |
73 | - return ServerResult.success(); | |
74 | - } | |
75 | - | |
76 | - @Override | |
77 | - public ServerResult listByPage(OrderOptLogQueryVO queryVO) { | |
78 | - LambdaQueryWrapper<OrderOptLogDO> queryWrapper = buildQueryByParam(queryVO); | |
79 | - Page page = new Page<>(queryVO.getPage(), queryVO.getPageSize()); | |
80 | - IPage<OrderOptLogDO> iPage = page(page, queryWrapper); | |
81 | - | |
82 | - Page<OrderOptLogResultVO> webVOPage = new Page<>(); | |
83 | - List<OrderOptLogDO> orderOptLogDOS = iPage.getRecords(); | |
84 | - if (CollectionUtils.isNotEmpty(orderOptLogDOS)) { | |
85 | - Set<Long> userIds = orderOptLogDOS.stream().map(OrderOptLogDO::getUserId).collect(Collectors.toSet()); | |
86 | - Map<Long, AdminUserDO> userDOMap = new HashMap<>(); | |
87 | - if (CollectionUtils.isNotEmpty(userIds)) { | |
88 | - List<AdminUserDO> userDOS = userService.listByIds(userIds); | |
89 | - if (CollectionUtils.isNotEmpty(userDOS)) { | |
90 | - userDOMap = userDOS.stream().collect(Collectors.toMap(AdminUserDO::getId, Function.identity())); | |
91 | - } | |
92 | - } | |
93 | - Map<Long, AdminUserDO> finalUserDOMap = userDOMap; | |
94 | - List<OrderOptLogResultVO> resultVOList = orderOptLogDOS.stream().map(x -> { | |
95 | - OrderOptLogResultVO resultVO = new OrderOptLogResultVO(); | |
96 | - BeanUtils.copyProperties(x, resultVO); | |
97 | - if (finalUserDOMap.containsKey(x.getUserId())) { | |
98 | - resultVO.setUserName(finalUserDOMap.get(x.getUserId()).getUserName()); | |
99 | - } | |
100 | - return resultVO; | |
101 | - }).collect(Collectors.toList()); | |
102 | - | |
103 | - webVOPage.setRecords(resultVOList); | |
104 | - } | |
105 | - BeanUtils.copyProperties(page, webVOPage, "records"); | |
106 | - return ServerResult.success(webVOPage); | |
107 | - } | |
108 | - | |
109 | - /** | |
110 | - * @param queryVO | |
111 | - * @return | |
112 | - */ | |
113 | - private LambdaQueryWrapper<OrderOptLogDO> buildQueryByParam(OrderOptLogQueryVO queryVO) { | |
114 | - return new LambdaQueryWrapper<OrderOptLogDO>() | |
115 | - .eq(BaseDO::getEnableFlag, Constant.ENABLE_TEN) | |
116 | - .eq(Objects.nonNull(queryVO.getOrderId()), OrderOptLogDO::getOrderId, queryVO.getOrderId()) | |
117 | - .orderByDesc(OrderOptLogDO::getId) | |
118 | - ; | |
119 | - } | |
120 | - | |
121 | - /** | |
122 | - * 新增数据 | |
123 | - * | |
124 | - * @param orderOptLogVO 实例对象 | |
125 | - * @return 实例对象 | |
126 | - */ | |
127 | - @Override | |
128 | - public ServerResult add(OrderOptLogVO orderOptLogVO) { | |
129 | - //todo 校验 | |
130 | - if (Objects.nonNull(orderOptLogVO.getId())) { | |
131 | - orderOptLogVO.setId(null); | |
132 | - } | |
133 | - OrderOptLogDO orderOptLogDo = BeanUtil.copyProperties(orderOptLogVO, OrderOptLogDO.class); | |
134 | - | |
135 | - save(orderOptLogDo); | |
136 | - | |
137 | - return ServerResult.success(); | |
138 | - } | |
139 | - | |
140 | - /** | |
141 | - * 修改数据 | |
142 | - * | |
143 | - * @param orderOptLogVO 实例对象 | |
144 | - * @return 实例对象 | |
145 | - */ | |
146 | - @Override | |
147 | - public ServerResult edit(OrderOptLogVO orderOptLogVO) { | |
148 | - //todo 校验 | |
149 | - if (Objects.isNull(orderOptLogVO.getId())) { | |
150 | - return ServerResult.fail("id 不能为空"); | |
151 | - } | |
152 | - OrderOptLogDO orderOptLogDo = BeanUtil.copyProperties(orderOptLogVO, OrderOptLogDO.class); | |
153 | - | |
154 | - updateById(orderOptLogDo); | |
155 | - | |
156 | - return ServerResult.success(); | |
157 | - } | |
158 | - | |
159 | - /** | |
160 | - * 通过主键删除数据 | |
161 | - * | |
162 | - * @param orderOptLogQueryVO 筛选条件 | |
163 | - * @return 是否成功 | |
164 | - */ | |
165 | - @Override | |
166 | - public ServerResult deleteById(OrderOptLogQueryVO orderOptLogQueryVO) { | |
167 | - List<Long> ids = orderOptLogQueryVO.getIds(); | |
168 | - if (CollUtil.isEmpty(ids)) { | |
169 | - return ServerResult.fail("ids 参数不能为空"); | |
170 | - } | |
171 | - List<OrderOptLogDO> orderOptLogList = listByIds(ids); | |
172 | - if (CollUtil.isEmpty(orderOptLogList)) { | |
173 | - return ServerResult.success(); | |
174 | - } | |
175 | - //todo 校验是否可以逻辑删除 | |
176 | - LambdaUpdateWrapper<OrderOptLogDO> updateWrapper = new LambdaUpdateWrapper<OrderOptLogDO>() | |
177 | - .in(OrderOptLogDO::getId, ids) | |
178 | - .set(OrderOptLogDO::getEnableFlag, Constant.UNABLE_TWENTY); | |
179 | - update(updateWrapper); | |
180 | - return ServerResult.success(); | |
181 | - } | |
182 | - | |
183 | - /** | |
184 | - * 通过订单id逻辑删除 | |
185 | - * | |
186 | - * @param orderId | |
187 | - * @return | |
188 | - */ | |
189 | - @Override | |
190 | - public boolean deleteByOrderId(Long orderId) { | |
191 | - LambdaUpdateWrapper<OrderOptLogDO> updateWrapper = new LambdaUpdateWrapper<OrderOptLogDO>() | |
192 | - .eq(OrderOptLogDO::getOrderId, orderId) | |
193 | - .set(OrderOptLogDO::getEnableFlag, Constant.UNABLE_TWENTY); | |
194 | - return update(updateWrapper); | |
195 | - } | |
196 | - | |
197 | - @Override | |
198 | - public boolean deleteByOrderIds(List<Long> orderIds) { | |
199 | - LambdaUpdateWrapper<OrderOptLogDO> updateWrapper = new LambdaUpdateWrapper<OrderOptLogDO>() | |
200 | - .in(OrderOptLogDO::getOrderId, orderIds) | |
201 | - .set(OrderOptLogDO::getEnableFlag, Constant.UNABLE_TWENTY); | |
202 | - return update(updateWrapper); | |
203 | - } | |
204 | -} |
src/main/java/com/order/erp/service/order/impl/OrderProfitAnalysisServiceImpl.java deleted
100644 → 0
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.toolkit.CollectionUtils; | |
8 | -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | |
9 | -import com.order.erp.common.constant.Constant; | |
10 | -import com.order.erp.common.constant.ServerResult; | |
11 | -import com.order.erp.common.exception.BusinessException; | |
12 | -import com.order.erp.common.utils.ProfitUtils; | |
13 | -import com.order.erp.common.utils.StringUtils; | |
14 | -import com.order.erp.domain.dto.BaseDO; | |
15 | -import com.order.erp.domain.dto.order.OrderBaseInfoDO; | |
16 | -import com.order.erp.domain.dto.order.OrderProfitAnalysisDO; | |
17 | -import com.order.erp.domain.vo.OrderProfitAnalysisVo; | |
18 | -import com.order.erp.domain.vo.order.OrderProfitAnalysisQueryVO; | |
19 | -import com.order.erp.domain.vo.order.OrderProfitAnalysisVO; | |
20 | -import com.order.erp.domain.vo.order.ProfitCalculateVO; | |
21 | -import com.order.erp.mapper.order.OrderProfitAnalysisMapper; | |
22 | -import com.order.erp.service.order.OrderBaseInfoService; | |
23 | -import com.order.erp.service.order.OrderProfitAnalysisService; | |
24 | -import lombok.extern.slf4j.Slf4j; | |
25 | -import org.springframework.beans.BeanUtils; | |
26 | -import org.springframework.stereotype.Service; | |
27 | - | |
28 | -import javax.annotation.Resource; | |
29 | -import java.math.BigDecimal; | |
30 | -import java.util.HashSet; | |
31 | -import java.util.List; | |
32 | -import java.util.Objects; | |
33 | -import java.util.Set; | |
34 | -import java.util.stream.Collectors; | |
35 | - | |
36 | -/** | |
37 | - * 订单利润分析表(OrderProfitAnalysis)表服务实现类 | |
38 | - * | |
39 | - * @author makejava | |
40 | - * @since 2023-09-08 15:26:47 | |
41 | - */ | |
42 | -@Slf4j | |
43 | -@Service | |
44 | -public class OrderProfitAnalysisServiceImpl extends ServiceImpl<OrderProfitAnalysisMapper, OrderProfitAnalysisDO> implements OrderProfitAnalysisService { | |
45 | - | |
46 | - @Resource | |
47 | - private OrderBaseInfoService orderBaseInfoService; | |
48 | - | |
49 | - /** | |
50 | - * 通过ID查询单条数据 | |
51 | - * <p> | |
52 | - * orderProfitAnalysisQueryVO 主键 | |
53 | - * | |
54 | - * @return 实例对象 | |
55 | - */ | |
56 | - @Override | |
57 | - public ServerResult queryById(OrderProfitAnalysisQueryVO orderProfitAnalysisQueryVO) { | |
58 | - if (Objects.isNull(orderProfitAnalysisQueryVO.getId())) { | |
59 | - return ServerResult.fail("id 不能为空"); | |
60 | - } | |
61 | - OrderProfitAnalysisDO OrderProfitAnalysisDo = getById(orderProfitAnalysisQueryVO.getId()); | |
62 | - if (Objects.isNull(OrderProfitAnalysisDo)) { | |
63 | - return ServerResult.success(null); | |
64 | - } | |
65 | - return ServerResult.success(BeanUtil.copyProperties(OrderProfitAnalysisDo, OrderProfitAnalysisVO.class)); | |
66 | - } | |
67 | - | |
68 | - /** | |
69 | - * 分页查询 | |
70 | - * | |
71 | - * @param orderProfitAnalysisQueryVO 筛选条件 | |
72 | - * @return 查询结果 | |
73 | - */ | |
74 | - @Override | |
75 | - public ServerResult list(OrderProfitAnalysisQueryVO orderProfitAnalysisQueryVO) { | |
76 | - | |
77 | - return ServerResult.success(); | |
78 | - } | |
79 | - | |
80 | - /** | |
81 | - * 新增数据 | |
82 | - * | |
83 | - * @param orderProfitAnalysisVO 实例对象 | |
84 | - * @return 实例对象 | |
85 | - */ | |
86 | - @Override | |
87 | - public ServerResult add(OrderProfitAnalysisVO orderProfitAnalysisVO) { | |
88 | - //todo 校验 | |
89 | - if (Objects.nonNull(orderProfitAnalysisVO.getId())) { | |
90 | - orderProfitAnalysisVO.setId(null); | |
91 | - } | |
92 | - OrderProfitAnalysisDO orderProfitAnalysisDo = BeanUtil.copyProperties(orderProfitAnalysisVO, OrderProfitAnalysisDO.class); | |
93 | - | |
94 | - save(orderProfitAnalysisDo); | |
95 | - | |
96 | - return ServerResult.success(); | |
97 | - } | |
98 | - | |
99 | - /** | |
100 | - * 修改数据 | |
101 | - * | |
102 | - * @param orderProfitAnalysisVO 实例对象 | |
103 | - * @return 实例对象 | |
104 | - */ | |
105 | - @Override | |
106 | - public ServerResult edit(OrderProfitAnalysisVO orderProfitAnalysisVO) { | |
107 | - //todo 校验 | |
108 | - if (Objects.isNull(orderProfitAnalysisVO.getId())) { | |
109 | - return ServerResult.fail("id 不能为空"); | |
110 | - } | |
111 | - OrderProfitAnalysisDO orderProfitAnalysisDo = BeanUtil.copyProperties(orderProfitAnalysisVO, OrderProfitAnalysisDO.class); | |
112 | - | |
113 | - updateById(orderProfitAnalysisDo); | |
114 | - | |
115 | - return ServerResult.success(); | |
116 | - } | |
117 | - | |
118 | - /** | |
119 | - * 通过主键删除数据 | |
120 | - * | |
121 | - * @param orderProfitAnalysisQueryVO 筛选条件 | |
122 | - * @return 是否成功 | |
123 | - */ | |
124 | - @Override | |
125 | - public ServerResult deleteById(OrderProfitAnalysisQueryVO orderProfitAnalysisQueryVO) { | |
126 | - List<Long> ids = orderProfitAnalysisQueryVO.getIds(); | |
127 | - if (CollUtil.isEmpty(ids)) { | |
128 | - return ServerResult.fail("ids 参数不能为空"); | |
129 | - } | |
130 | - List<OrderProfitAnalysisDO> orderProfitAnalysisList = listByIds(ids); | |
131 | - if (CollUtil.isEmpty(orderProfitAnalysisList)) { | |
132 | - return ServerResult.success(); | |
133 | - } | |
134 | - //todo 校验是否可以逻辑删除 | |
135 | - LambdaUpdateWrapper<OrderProfitAnalysisDO> updateWrapper = new LambdaUpdateWrapper<OrderProfitAnalysisDO>() | |
136 | - .in(OrderProfitAnalysisDO::getId, ids) | |
137 | - .set(OrderProfitAnalysisDO::getEnableFlag, Constant.UNABLE_TWENTY); | |
138 | - update(updateWrapper); | |
139 | - return ServerResult.success(); | |
140 | - } | |
141 | - | |
142 | - /** | |
143 | - * 通过订单id逻辑删除 | |
144 | - * | |
145 | - * @param orderId | |
146 | - * @return | |
147 | - */ | |
148 | - @Override | |
149 | - public boolean deleteByOrderId(Long orderId) { | |
150 | - LambdaUpdateWrapper<OrderProfitAnalysisDO> updateWrapper = new LambdaUpdateWrapper<OrderProfitAnalysisDO>() | |
151 | - .eq(OrderProfitAnalysisDO::getOrderId, orderId) | |
152 | - .set(OrderProfitAnalysisDO::getEnableFlag, Constant.UNABLE_TWENTY); | |
153 | - return update(updateWrapper); | |
154 | - } | |
155 | - | |
156 | - @Override | |
157 | - public boolean deleteByOrderIds(List<Long> orderIds) { | |
158 | - LambdaUpdateWrapper<OrderProfitAnalysisDO> updateWrapper = new LambdaUpdateWrapper<OrderProfitAnalysisDO>() | |
159 | - .in(OrderProfitAnalysisDO::getOrderId, orderIds) | |
160 | - .set(OrderProfitAnalysisDO::getEnableFlag, Constant.UNABLE_TWENTY); | |
161 | - return update(updateWrapper); | |
162 | - } | |
163 | - | |
164 | - @Override | |
165 | - public ServerResult calculate(ProfitCalculateVO calculateVO) { | |
166 | - return ServerResult.success(ProfitUtils.calculateProfitRate(calculateVO)); | |
167 | - } | |
168 | - | |
169 | - @Override | |
170 | - public ServerResult<OrderProfitAnalysisVO> analysisByQueryVO(OrderProfitAnalysisVo profitAnalysisVo) { | |
171 | - LambdaQueryWrapper<OrderBaseInfoDO> queryWrapper = orderBaseInfoService.buildQueryByParam(profitAnalysisVo.getQueryVO()); | |
172 | - List<OrderBaseInfoDO> orderBaseInfoDOList = orderBaseInfoService.list(queryWrapper); | |
173 | - if (CollectionUtils.isEmpty(orderBaseInfoDOList)) { | |
174 | - throw new BusinessException("页面未查询到数据,请重置刷新页面后操作"); | |
175 | - } | |
176 | - //查询订单id的利润分析数据 | |
177 | - List<OrderProfitAnalysisDO> orderProfits = list(new LambdaQueryWrapper<OrderProfitAnalysisDO>() | |
178 | - .eq(BaseDO::getEnableFlag, Constant.ENABLE_TEN) | |
179 | - .in(OrderProfitAnalysisDO::getOrderId, orderBaseInfoDOList.stream().map(OrderBaseInfoDO::getId).collect(Collectors.toSet()))); | |
180 | - | |
181 | - if (CollectionUtils.isEmpty(orderProfits)) { | |
182 | - throw new BusinessException("选中的订单信息不存在"); | |
183 | - } | |
184 | - return wrapperProfitResult(profitAnalysisVo, orderProfits); | |
185 | - } | |
186 | - | |
187 | - @Override | |
188 | - public ServerResult<OrderProfitAnalysisVO> analysis(OrderProfitAnalysisVo orderProfitAnalysisVo) { | |
189 | - if (CollectionUtils.isNotEmpty(orderProfitAnalysisVo.getOrderIds())) { | |
190 | - return analysisByOrderIds(orderProfitAnalysisVo); | |
191 | - } | |
192 | - return analysisByQueryVO(orderProfitAnalysisVo); | |
193 | - } | |
194 | - | |
195 | - @Override | |
196 | - public ServerResult<OrderProfitAnalysisVO> analysisByOrderIds(OrderProfitAnalysisVo profitAnalysisVo) { | |
197 | - //查询订单id的利润分析数据 | |
198 | - List<OrderProfitAnalysisDO> orderProfits = list(new LambdaQueryWrapper<OrderProfitAnalysisDO>() | |
199 | - .eq(BaseDO::getEnableFlag, Constant.ENABLE_TEN) | |
200 | - .in(OrderProfitAnalysisDO::getOrderId, profitAnalysisVo.getOrderIds())); | |
201 | - | |
202 | - if (CollectionUtils.isEmpty(orderProfits)) { | |
203 | - throw new BusinessException("选中的订单信息不存在"); | |
204 | - } | |
205 | - | |
206 | - return wrapperProfitResult(profitAnalysisVo, orderProfits); | |
207 | - } | |
208 | - | |
209 | - /** | |
210 | - * @param profitAnalysisVo | |
211 | - * @param orderProfits | |
212 | - * @return | |
213 | - */ | |
214 | - private ServerResult<OrderProfitAnalysisVO> wrapperProfitResult(OrderProfitAnalysisVo profitAnalysisVo, List<OrderProfitAnalysisDO> orderProfits) { | |
215 | - BigDecimal packetTotalPrice = new BigDecimal(Constant.ZERO_STRING); | |
216 | - BigDecimal customerTotalPrice = new BigDecimal(Constant.ZERO_STRING); | |
217 | - BigDecimal productionDepartmentTotalPrice = new BigDecimal(Constant.ZERO_STRING); | |
218 | - for (OrderProfitAnalysisDO orderProfit : orderProfits) { | |
219 | - ProfitCalculateVO profitCalculateVO = new ProfitCalculateVO(); | |
220 | - BeanUtils.copyProperties(orderProfit, profitCalculateVO); | |
221 | - packetTotalPrice = packetTotalPrice.add(new BigDecimal(orderProfit.getPacketTotalPrice())); | |
222 | - customerTotalPrice = customerTotalPrice.add(new BigDecimal(orderProfit.getCustomerTotalPrice())); | |
223 | - productionDepartmentTotalPrice = productionDepartmentTotalPrice.add(new BigDecimal(orderProfit.getProductionDepartmentTotalPrice())); | |
224 | - } | |
225 | - List<OrderBaseInfoDO> orderBaseInfoDOS = orderBaseInfoService.listByIds(orderProfits.stream().map(OrderProfitAnalysisDO::getOrderId).collect(Collectors.toSet())); | |
226 | - int orderTotalNum = 0; | |
227 | - Set<String> innerNoSet = new HashSet<>(); | |
228 | - for (OrderBaseInfoDO orderBaseInfoDO : orderBaseInfoDOS) { | |
229 | - if (Objects.nonNull(orderBaseInfoDO.getOrderCount())) { | |
230 | - orderTotalNum += orderBaseInfoDO.getOrderCount(); | |
231 | - } | |
232 | - innerNoSet.add(orderBaseInfoDO.getInnerNo()); | |
233 | - } | |
234 | - OrderProfitAnalysisVO profitAnalysisVO = new OrderProfitAnalysisVO(); | |
235 | - profitAnalysisVO.setPacketTotalPrice(packetTotalPrice.doubleValue()); | |
236 | - profitAnalysisVO.setCustomerTotalPrice(customerTotalPrice.doubleValue()); | |
237 | - profitAnalysisVO.setProductionDepartmentTotalPrice(productionDepartmentTotalPrice.doubleValue()); | |
238 | - profitAnalysisVO.setProfitRate(ProfitUtils.calculateProfitRate(ProfitCalculateVO.builder() | |
239 | - .profitType(StringUtils.isBlank(profitAnalysisVo.getProfitType()) ? Constant.ZERO : Integer.parseInt(profitAnalysisVo.getProfitType())) | |
240 | - .exchangeRate(Double.parseDouble(profitAnalysisVo.getExchangeRate())) | |
241 | - .productionDepartmentTotalPrice(productionDepartmentTotalPrice.doubleValue()) | |
242 | - .packetTotalPrice(packetTotalPrice.doubleValue()) | |
243 | - .customerTotalPrice(customerTotalPrice.doubleValue()).build())); | |
244 | - profitAnalysisVO.setOrderTotalNum(orderTotalNum); | |
245 | - profitAnalysisVO.setRecordNum(innerNoSet.size()); | |
246 | - | |
247 | - return ServerResult.success(profitAnalysisVO); | |
248 | - } | |
249 | - | |
250 | - @Override | |
251 | - public long countByOrderStatus(Integer status) { | |
252 | - return this.count(new LambdaQueryWrapper<OrderProfitAnalysisDO>().eq(OrderProfitAnalysisDO::getOrderStatus, status) | |
253 | - .eq(OrderProfitAnalysisDO::getEnableFlag, Constant.ENABLE_TEN)); | |
254 | - } | |
255 | - | |
256 | - @Override | |
257 | - public long countRecentWeekByOrderStatus(Integer status) { | |
258 | - return this.baseMapper.countRecentWeekByOrderStatus(status); | |
259 | - } | |
260 | -} |
src/main/java/com/order/erp/service/order/impl/OrderTrackStageServiceImpl.java deleted
100644 → 0
1 | -package com.order.erp.service.order.impl; | |
2 | - | |
3 | -import cn.hutool.core.bean.BeanUtil; | |
4 | -import cn.hutool.core.collection.CollUtil; | |
5 | -import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; | |
6 | -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | |
7 | -import com.order.erp.common.constant.Constant; | |
8 | -import com.order.erp.common.constant.ServerResult; | |
9 | -import com.order.erp.domain.dto.order.OrderTrackStageDO; | |
10 | -import com.order.erp.domain.vo.order.OrderTrackStageQueryVO; | |
11 | -import com.order.erp.domain.vo.order.OrderTrackStageVO; | |
12 | -import com.order.erp.mapper.order.OrderTrackStageMapper; | |
13 | -import com.order.erp.service.order.OrderTrackStageService; | |
14 | -import lombok.extern.slf4j.Slf4j; | |
15 | -import org.springframework.stereotype.Service; | |
16 | - | |
17 | -import java.util.List; | |
18 | -import java.util.Objects; | |
19 | - | |
20 | -/** | |
21 | - * 订单-跟单环节(OrderTrackStage)表服务实现类 | |
22 | - * | |
23 | - * @author makejava | |
24 | - * @since 2023-09-08 15:26:48 | |
25 | - */ | |
26 | -@Slf4j | |
27 | -@Service | |
28 | -public class OrderTrackStageServiceImpl extends ServiceImpl<OrderTrackStageMapper, OrderTrackStageDO> implements OrderTrackStageService { | |
29 | - | |
30 | - | |
31 | - /** | |
32 | - * 通过ID查询单条数据 | |
33 | - * <p> | |
34 | - * orderTrackStageQueryVO 主键 | |
35 | - * | |
36 | - * @return 实例对象 | |
37 | - */ | |
38 | - @Override | |
39 | - public ServerResult queryById(OrderTrackStageQueryVO orderTrackStageQueryVO) { | |
40 | - if (Objects.isNull(orderTrackStageQueryVO.getId())) { | |
41 | - return ServerResult.fail("id 不能为空"); | |
42 | - } | |
43 | - OrderTrackStageDO OrderTrackStageDo = getById(orderTrackStageQueryVO.getId()); | |
44 | - if (Objects.isNull(OrderTrackStageDo)) { | |
45 | - return ServerResult.success(null); | |
46 | - } | |
47 | - return ServerResult.success(BeanUtil.copyProperties(OrderTrackStageDo, OrderTrackStageVO.class)); | |
48 | - } | |
49 | - | |
50 | - /** | |
51 | - * 分页查询 | |
52 | - * | |
53 | - * @param orderTrackStageQueryVO 筛选条件 | |
54 | - * @return 查询结果 | |
55 | - */ | |
56 | - @Override | |
57 | - public ServerResult list(OrderTrackStageQueryVO orderTrackStageQueryVO) { | |
58 | - | |
59 | - return ServerResult.success(); | |
60 | - } | |
61 | - | |
62 | - /** | |
63 | - * 新增数据 | |
64 | - * | |
65 | - * @param orderTrackStageVO 实例对象 | |
66 | - * @return 实例对象 | |
67 | - */ | |
68 | - @Override | |
69 | - public ServerResult add(OrderTrackStageVO orderTrackStageVO) { | |
70 | - //todo 校验 | |
71 | - if (Objects.nonNull(orderTrackStageVO.getId())) { | |
72 | - orderTrackStageVO.setId(null); | |
73 | - } | |
74 | - OrderTrackStageDO orderTrackStageDo = BeanUtil.copyProperties(orderTrackStageVO, OrderTrackStageDO.class); | |
75 | - | |
76 | - save(orderTrackStageDo); | |
77 | - | |
78 | - return ServerResult.success(); | |
79 | - } | |
80 | - | |
81 | - /** | |
82 | - * 修改数据 | |
83 | - * | |
84 | - * @param orderTrackStageVO 实例对象 | |
85 | - * @return 实例对象 | |
86 | - */ | |
87 | - @Override | |
88 | - public ServerResult edit(OrderTrackStageVO orderTrackStageVO) { | |
89 | - //todo 校验 | |
90 | - if (Objects.isNull(orderTrackStageVO.getId())) { | |
91 | - return ServerResult.fail("id 不能为空"); | |
92 | - } | |
93 | - OrderTrackStageDO orderTrackStageDo = BeanUtil.copyProperties(orderTrackStageVO, OrderTrackStageDO.class); | |
94 | - | |
95 | - updateById(orderTrackStageDo); | |
96 | - | |
97 | - return ServerResult.success(); | |
98 | - } | |
99 | - | |
100 | - /** | |
101 | - * 通过主键删除数据 | |
102 | - * | |
103 | - * @param orderTrackStageQueryVO 筛选条件 | |
104 | - * @return 是否成功 | |
105 | - */ | |
106 | - @Override | |
107 | - public ServerResult deleteById(OrderTrackStageQueryVO orderTrackStageQueryVO) { | |
108 | - List<Long> ids = orderTrackStageQueryVO.getIds(); | |
109 | - if (CollUtil.isEmpty(ids)) { | |
110 | - return ServerResult.fail("ids 参数不能为空"); | |
111 | - } | |
112 | - List<OrderTrackStageDO> orderTrackStageList = listByIds(ids); | |
113 | - if (CollUtil.isEmpty(orderTrackStageList)) { | |
114 | - return ServerResult.success(); | |
115 | - } | |
116 | - //todo 校验是否可以逻辑删除 | |
117 | - LambdaUpdateWrapper<OrderTrackStageDO> updateWrapper = new LambdaUpdateWrapper<OrderTrackStageDO>() | |
118 | - .in(OrderTrackStageDO::getId, ids) | |
119 | - .set(OrderTrackStageDO::getEnableFlag, Constant.UNABLE_TWENTY); | |
120 | - update(updateWrapper); | |
121 | - return ServerResult.success(); | |
122 | - } | |
123 | - | |
124 | - /** | |
125 | - * 通过订单id逻辑删除 | |
126 | - * @param orderId | |
127 | - * @return | |
128 | - */ | |
129 | - @Override | |
130 | - public boolean deleteByOrderId(Long orderId) { | |
131 | - LambdaUpdateWrapper<OrderTrackStageDO> updateWrapper = new LambdaUpdateWrapper<OrderTrackStageDO>() | |
132 | - .eq(OrderTrackStageDO::getOrderId, orderId) | |
133 | - .set(OrderTrackStageDO::getEnableFlag, Constant.UNABLE_TWENTY); | |
134 | - return update(updateWrapper); | |
135 | - } | |
136 | - | |
137 | - @Override | |
138 | - public boolean deleteByOrderIds(List<Long> orderIds) { | |
139 | - LambdaUpdateWrapper<OrderTrackStageDO> updateWrapper = new LambdaUpdateWrapper<OrderTrackStageDO>() | |
140 | - .in(OrderTrackStageDO::getOrderId, orderIds) | |
141 | - .set(OrderTrackStageDO::getEnableFlag, Constant.UNABLE_TWENTY); | |
142 | - return update(updateWrapper); | |
143 | - } | |
144 | -} |
src/main/java/com/order/erp/service/order/impl/OrderUpdateLogServiceImpl.java deleted
100644 → 0
1 | -package com.order.erp.service.order.impl; | |
2 | - | |
3 | -import cn.hutool.core.bean.BeanUtil; | |
4 | -import cn.hutool.core.collection.CollUtil; | |
5 | -import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; | |
6 | -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | |
7 | -import com.order.erp.common.constant.Constant; | |
8 | -import com.order.erp.common.constant.ServerResult; | |
9 | -import com.order.erp.common.utils.PageUtils; | |
10 | -import com.order.erp.domain.dto.order.OrderUpdateLogDO; | |
11 | -import com.order.erp.domain.vo.order.OrderUpdateLogQueryVO; | |
12 | -import com.order.erp.domain.vo.order.OrderUpdateLogVO; | |
13 | -import com.order.erp.mapper.order.OrderUpdateLogMapper; | |
14 | -import com.order.erp.service.order.OrderUpdateLogService; | |
15 | -import lombok.extern.slf4j.Slf4j; | |
16 | -import org.springframework.stereotype.Service; | |
17 | - | |
18 | -import java.util.List; | |
19 | -import java.util.Objects; | |
20 | - | |
21 | -/** | |
22 | - * 订单更新日志表(OrderUpdateLog)表服务实现类 | |
23 | - * | |
24 | - * @author makejava | |
25 | - * @since 2024-07-03 17:30:32 | |
26 | - */ | |
27 | -@Slf4j | |
28 | -@Service | |
29 | -public class OrderUpdateLogServiceImpl extends ServiceImpl<OrderUpdateLogMapper, OrderUpdateLogDO> implements OrderUpdateLogService { | |
30 | - | |
31 | - | |
32 | - /** | |
33 | - * 通过ID查询单条数据 | |
34 | - * <p> | |
35 | - * orderUpdateLogQueryVO 主键 | |
36 | - * | |
37 | - * @return 实例对象 | |
38 | - */ | |
39 | - @Override | |
40 | - public ServerResult queryById(OrderUpdateLogQueryVO orderUpdateLogQueryVO) { | |
41 | - if (Objects.isNull(orderUpdateLogQueryVO.getId())) { | |
42 | - return ServerResult.fail("id 不能为空"); | |
43 | - } | |
44 | - OrderUpdateLogDO OrderUpdateLogDo = getById(orderUpdateLogQueryVO.getId()); | |
45 | - if (Objects.isNull(OrderUpdateLogDo)) { | |
46 | - return ServerResult.success(null); | |
47 | - } | |
48 | - return ServerResult.success(BeanUtil.copyProperties(OrderUpdateLogDo, OrderUpdateLogVO.class)); | |
49 | - } | |
50 | - | |
51 | - /** | |
52 | - * 分页查询 | |
53 | - * | |
54 | - * @param orderUpdateLogQueryVO 筛选条件 | |
55 | - * @return 查询结果 | |
56 | - */ | |
57 | - @Override | |
58 | - public ServerResult list(OrderUpdateLogQueryVO orderUpdateLogQueryVO) { | |
59 | - | |
60 | - return ServerResult.success(PageUtils.getPageReturn(null, orderUpdateLogQueryVO)); | |
61 | - } | |
62 | - | |
63 | - /** | |
64 | - * 新增数据 | |
65 | - * | |
66 | - * @param orderUpdateLogVO 实例对象 | |
67 | - * @return 实例对象 | |
68 | - */ | |
69 | - @Override | |
70 | - public ServerResult add(OrderUpdateLogVO orderUpdateLogVO) { | |
71 | - //todo 校验 | |
72 | - if (Objects.nonNull(orderUpdateLogVO.getId())) { | |
73 | - orderUpdateLogVO.setId(null); | |
74 | - } | |
75 | - OrderUpdateLogDO orderUpdateLogDo = BeanUtil.copyProperties(orderUpdateLogVO, OrderUpdateLogDO.class); | |
76 | - | |
77 | - save(orderUpdateLogDo); | |
78 | - | |
79 | - return ServerResult.success(); | |
80 | - } | |
81 | - | |
82 | - /** | |
83 | - * 修改数据 | |
84 | - * | |
85 | - * @param orderUpdateLogVO 实例对象 | |
86 | - * @return 实例对象 | |
87 | - */ | |
88 | - @Override | |
89 | - public ServerResult edit(OrderUpdateLogVO orderUpdateLogVO) { | |
90 | - //todo 校验 | |
91 | - if (Objects.isNull(orderUpdateLogVO.getId())) { | |
92 | - return ServerResult.fail("id 不能为空"); | |
93 | - } | |
94 | - OrderUpdateLogDO orderUpdateLogDo = BeanUtil.copyProperties(orderUpdateLogVO, OrderUpdateLogDO.class); | |
95 | - | |
96 | - updateById(orderUpdateLogDo); | |
97 | - | |
98 | - return ServerResult.success(); | |
99 | - } | |
100 | - | |
101 | - /** | |
102 | - * 通过主键删除数据 | |
103 | - * | |
104 | - * @param orderUpdateLogQueryVO 筛选条件 | |
105 | - * @return 是否成功 | |
106 | - */ | |
107 | - @Override | |
108 | - public ServerResult deleteById(OrderUpdateLogQueryVO orderUpdateLogQueryVO) { | |
109 | - List<Long> ids = orderUpdateLogQueryVO.getIds(); | |
110 | - if (CollUtil.isEmpty(ids)) { | |
111 | - return ServerResult.fail("ids 参数不能为空"); | |
112 | - } | |
113 | - List<OrderUpdateLogDO> orderUpdateLogList = listByIds(ids); | |
114 | - if (CollUtil.isEmpty(orderUpdateLogList)) { | |
115 | - return ServerResult.success(); | |
116 | - } | |
117 | - //todo 校验是否可以逻辑删除 | |
118 | - LambdaUpdateWrapper<OrderUpdateLogDO> updateWrapper = new LambdaUpdateWrapper<OrderUpdateLogDO>() | |
119 | - .in(OrderUpdateLogDO::getId, ids) | |
120 | - .set(OrderUpdateLogDO::getEnableFlag, Constant.UNABLE_TWENTY); | |
121 | - update(updateWrapper); | |
122 | - return ServerResult.success(); | |
123 | - } | |
124 | -} |
src/main/java/com/order/erp/service/order/impl/ProducePaymentCheckBillOrderServiceImpl.java deleted
100644 → 0
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 deleted
100644 → 0
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.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 | -import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; | |
10 | -import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; | |
11 | -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | |
12 | -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | |
13 | -import com.order.erp.common.constant.Constant; | |
14 | -import com.order.erp.common.constant.ServerResult; | |
15 | -import com.order.erp.domain.dto.order.ReceiveEmailMappingDO; | |
16 | -import com.order.erp.domain.vo.order.ReceiveEmailMappingQueryVO; | |
17 | -import com.order.erp.domain.vo.order.ReceiveEmailMappingVO; | |
18 | -import com.order.erp.mapper.order.ReceiveEmailMappingMapper; | |
19 | -import com.order.erp.service.order.ReceiveEmailMappingService; | |
20 | -import lombok.extern.slf4j.Slf4j; | |
21 | -import org.springframework.stereotype.Service; | |
22 | -import java.util.List; | |
23 | -import java.util.Objects; | |
24 | - | |
25 | -/** | |
26 | - * 邮件接收人信息绑定表(ReceiveEmailMapping)表服务实现类 | |
27 | - * | |
28 | - * @author makejava | |
29 | - * @since 2024-07-03 10:58:52 | |
30 | - */ | |
31 | -@Slf4j | |
32 | -@Service | |
33 | -public class ReceiveEmailMappingServiceImpl extends ServiceImpl<ReceiveEmailMappingMapper, ReceiveEmailMappingDO> implements ReceiveEmailMappingService { | |
34 | - | |
35 | - | |
36 | - /** | |
37 | - * 通过ID查询单条数据 | |
38 | - * <p> | |
39 | - * receiveEmailMappingQueryVO 主键 | |
40 | - * | |
41 | - * @return 实例对象 | |
42 | - */ | |
43 | - @Override | |
44 | - public ServerResult queryById(ReceiveEmailMappingQueryVO receiveEmailMappingQueryVO) { | |
45 | - if (Objects.isNull(receiveEmailMappingQueryVO.getId())) { | |
46 | - return ServerResult.fail("id 不能为空"); | |
47 | - } | |
48 | - ReceiveEmailMappingDO ReceiveEmailMappingDo = getById(receiveEmailMappingQueryVO.getId()); | |
49 | - if (Objects.isNull(ReceiveEmailMappingDo)) { | |
50 | - return ServerResult.success(null); | |
51 | - } | |
52 | - return ServerResult.success(BeanUtil.copyProperties(ReceiveEmailMappingDo, ReceiveEmailMappingVO.class)); | |
53 | - } | |
54 | - | |
55 | - /** | |
56 | - * 分页查询 | |
57 | - * | |
58 | - * @return 查询结果 | |
59 | - */ | |
60 | - @Override | |
61 | - public ServerResult listGetAll() { | |
62 | - Page<ReceiveEmailMappingDO> receiveEmailMappingDOPage = new Page<>(); | |
63 | - List<ReceiveEmailMappingDO> receiveEmailMappingDOList = baseMapper.listGetAll(Constant.ENABLE_TEN, Constant.THIRTY); | |
64 | - receiveEmailMappingDOPage.setRecords(receiveEmailMappingDOList); | |
65 | - return ServerResult.success(receiveEmailMappingDOPage); | |
66 | - } | |
67 | - | |
68 | - /** | |
69 | - * 新增数据 | |
70 | - * | |
71 | - * @param receiveEmailMappingVO 实例对象 | |
72 | - * @return 实例对象 | |
73 | - */ | |
74 | - @Override | |
75 | - public ServerResult add(ReceiveEmailMappingVO receiveEmailMappingVO) { | |
76 | - //todo 校验 | |
77 | - if (Objects.nonNull(receiveEmailMappingVO.getId())) { | |
78 | - receiveEmailMappingVO.setId(null); | |
79 | - } | |
80 | - ReceiveEmailMappingDO receiveEmailMappingDo = BeanUtil.copyProperties(receiveEmailMappingVO, ReceiveEmailMappingDO.class); | |
81 | - receiveEmailMappingDo.setConfigInfos(JSONObject.toJSONString(receiveEmailMappingVO.getConfigInfos())); | |
82 | - save(receiveEmailMappingDo); | |
83 | - return ServerResult.success(); | |
84 | - } | |
85 | - | |
86 | - /** | |
87 | - * 修改数据 | |
88 | - * | |
89 | - * @param receiveEmailMappingVO 实例对象 | |
90 | - * @return 实例对象 | |
91 | - */ | |
92 | - @Override | |
93 | - public ServerResult edit(ReceiveEmailMappingVO receiveEmailMappingVO) { | |
94 | - //todo 校验 | |
95 | - if (Objects.isNull(receiveEmailMappingVO.getId())) { | |
96 | - return ServerResult.fail("id 不能为空"); | |
97 | - } | |
98 | - ReceiveEmailMappingDO receiveEmailMappingDo = BeanUtil.copyProperties(receiveEmailMappingVO, ReceiveEmailMappingDO.class); | |
99 | - receiveEmailMappingDo.setConfigInfos(JSONObject.toJSONString(receiveEmailMappingVO.getConfigInfos())); | |
100 | - updateById(receiveEmailMappingDo); | |
101 | - return ServerResult.success(); | |
102 | - } | |
103 | - | |
104 | - /** | |
105 | - * 通过主键删除数据 | |
106 | - * | |
107 | - * @param receiveEmailMappingVO 筛选条件 | |
108 | - * @return 是否成功 | |
109 | - */ | |
110 | - @Override | |
111 | - public ServerResult deleteById(ReceiveEmailMappingVO receiveEmailMappingVO) { | |
112 | - if (ObjectUtils.isNull(receiveEmailMappingVO.getId())) { | |
113 | - return ServerResult.fail("id 参数不能为空"); | |
114 | - } | |
115 | - ReceiveEmailMappingDO receiveEmailMappingDO = baseMapper.getReceiveEmailMappingDO(receiveEmailMappingVO.getId()); | |
116 | - if (ObjectUtils.isNull(receiveEmailMappingDO)) { | |
117 | - return ServerResult.success(); | |
118 | - } | |
119 | - baseMapper.updateEnable(receiveEmailMappingDO.getId(), Constant.UNABLE_TWENTY); | |
120 | - return ServerResult.success(); | |
121 | - } | |
122 | - /** | |
123 | - * 启用/禁用记录 | |
124 | - * | |
125 | - * @param receiveEmailMappingDo 实例对象 | |
126 | - * @return 是否成功 | |
127 | - */ | |
128 | - @Override | |
129 | - public ServerResult opt(ReceiveEmailMappingDO receiveEmailMappingDo) { | |
130 | - if(ObjectUtils.isNull(receiveEmailMappingDo.getId())){ | |
131 | - return ServerResult.fail("id 参数不能为空"); | |
132 | - } | |
133 | - ReceiveEmailMappingDO receiveEmailMappingDO = baseMapper.getReceiveEmailMappingDO(receiveEmailMappingDo.getId()); | |
134 | - if (Objects.isNull(receiveEmailMappingDO)){ | |
135 | - return ServerResult.success(); | |
136 | - } | |
137 | - if(Constant.ENABLE_TEN==receiveEmailMappingDo.getEnableFlag()){ | |
138 | - baseMapper.updateEnable(receiveEmailMappingDO.getId(), Constant.ENABLE_TEN); | |
139 | - }else if(Constant.THIRTY==receiveEmailMappingDo.getEnableFlag()){ | |
140 | - baseMapper.updateEnable(receiveEmailMappingDO.getId(), Constant.THIRTY); | |
141 | - } | |
142 | - return ServerResult.success(); | |
143 | - } | |
144 | -} |