Commit a441cb72289ab17827ada0d894ef58cee5aefb21
Merge branch 'fix-main-ch' into 'main'
fix:剔除多余代码 See merge request !2
Showing
19 changed files
with
35 additions
and
1896 deletions
pom.xml
... | ... | @@ -55,6 +55,12 @@ |
55 | 55 | <groupId>com.alibaba</groupId> |
56 | 56 | <artifactId>easyexcel</artifactId> |
57 | 57 | <version>${easyexcel.version}</version> |
58 | + <exclusions> | |
59 | + <exclusion> | |
60 | + <artifactId>asm</artifactId> | |
61 | + <groupId>org.ow2.asm</groupId> | |
62 | + </exclusion> | |
63 | + </exclusions> | |
58 | 64 | </dependency> |
59 | 65 | |
60 | 66 | <dependency> |
... | ... | @@ -86,6 +92,12 @@ |
86 | 92 | <artifactId>spring-boot-starter-test</artifactId> |
87 | 93 | <version>${springboot.version}</version> |
88 | 94 | <scope>test</scope> |
95 | + <exclusions> | |
96 | + <exclusion> | |
97 | + <artifactId>asm</artifactId> | |
98 | + <groupId>org.ow2.asm</groupId> | |
99 | + </exclusion> | |
100 | + </exclusions> | |
89 | 101 | </dependency> |
90 | 102 | |
91 | 103 | <dependency> |
... | ... | @@ -265,6 +277,12 @@ |
265 | 277 | <groupId>com.aliyun.oss</groupId> |
266 | 278 | <artifactId>aliyun-sdk-oss</artifactId> |
267 | 279 | <version>${aliyun-sdk-oss.version}</version> |
280 | + <exclusions> | |
281 | + <exclusion> | |
282 | + <artifactId>aliyun-java-sdk-core</artifactId> | |
283 | + <groupId>com.aliyun</groupId> | |
284 | + </exclusion> | |
285 | + </exclusions> | |
268 | 286 | </dependency> |
269 | 287 | |
270 | 288 | <!--thumbnailator 图片压缩工具--> |
... | ... | @@ -280,8 +298,25 @@ |
280 | 298 | <groupId>wiki.xsx</groupId> |
281 | 299 | <artifactId>x-easypdf-pdfbox</artifactId> |
282 | 300 | <version>${x-easypdf-pdfbox.version}</version> |
301 | + <exclusions> | |
302 | + <exclusion> | |
303 | + <artifactId>commons-logging</artifactId> | |
304 | + <groupId>commons-logging</groupId> | |
305 | + </exclusion> | |
306 | + </exclusions> | |
283 | 307 | </dependency> |
284 | 308 | |
309 | + <!--email邮件配置--> | |
310 | + <dependency> | |
311 | + <groupId>org.springframework.boot</groupId> | |
312 | + <artifactId>spring-boot-starter-mail</artifactId> | |
313 | + </dependency> | |
314 | + | |
315 | + <!--Freemarker--> | |
316 | + <dependency> | |
317 | + <groupId>org.springframework.boot</groupId> | |
318 | + <artifactId>spring-boot-starter-freemarker</artifactId> | |
319 | + </dependency> | |
285 | 320 | </dependencies> |
286 | 321 | <build> |
287 | 322 | <finalName>order-erp.service-1.0-SNAPSHOT</finalName> | ... | ... |
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.annotation.AnonymousAccess; | |
4 | -import com.order.erp.common.constant.ServerResult; | |
5 | -import com.order.erp.common.excel4j.exceptions.Excel4JException; | |
6 | -import com.order.erp.common.jsr303.OperateGroup; | |
7 | -import com.order.erp.domain.vo.order.*; | |
8 | -import com.order.erp.service.order.InvoiceBillOrderService; | |
9 | -import io.swagger.annotations.ApiOperation; | |
10 | -import org.springframework.validation.annotation.Validated; | |
11 | -import org.springframework.web.bind.annotation.PostMapping; | |
12 | -import org.springframework.web.bind.annotation.RequestBody; | |
13 | -import org.springframework.web.bind.annotation.RequestMapping; | |
14 | -import org.springframework.web.bind.annotation.RestController; | |
15 | - | |
16 | -import javax.annotation.Resource; | |
17 | -import javax.servlet.http.HttpServletResponse; | |
18 | -import java.io.IOException; | |
19 | - | |
20 | -/** | |
21 | - * 应收款账单表(InvoiceBillOrder)表控制层 | |
22 | - * | |
23 | - * @author makejava | |
24 | - * @since 2024-08-05 16:26:34 | |
25 | - */ | |
26 | -@RestController | |
27 | -@RequestMapping("/order/erp/invoice_bill") | |
28 | -public class InvoiceBillOrderController { | |
29 | - /** | |
30 | - * 服务对象 | |
31 | - */ | |
32 | - @Resource | |
33 | - private InvoiceBillOrderService invoiceBillOrderService; | |
34 | - | |
35 | - /** | |
36 | - * 分页查询 | |
37 | - * | |
38 | - * @param invoiceBillOrderQueryVO 查询条件 | |
39 | - * @return 查询结果 | |
40 | - */ | |
41 | - @PostMapping("/list_by_page") | |
42 | - public ServerResult listByPage(@RequestBody @Validated({OperateGroup.List.class}) InvoiceBillOrderQueryVO invoiceBillOrderQueryVO) { | |
43 | - return invoiceBillOrderService.listByPage(invoiceBillOrderQueryVO); | |
44 | - } | |
45 | - | |
46 | - /** | |
47 | - * 基础订单查询 | |
48 | - * | |
49 | - * @param queryVO 查询条件 | |
50 | - * @return 查询结果 | |
51 | - */ | |
52 | - @PostMapping("/list_base_order_info_by") | |
53 | - public ServerResult listBaseOrderInfoBy(@RequestBody @Validated InvoiceBaseOrderQueryVO queryVO) { | |
54 | - return invoiceBillOrderService.listBaseOrderInfoBy(queryVO); | |
55 | - } | |
56 | - | |
57 | - /** | |
58 | - * 分析列表 | |
59 | - * | |
60 | - * @param queryVO 查询条件 | |
61 | - * @return 查询结果 | |
62 | - */ | |
63 | - @PostMapping("/list_analysis_by") | |
64 | - public ServerResult listAnalysisBy(@RequestBody @Validated({OperateGroup.List.class}) InvoiceBillAnalysisVO queryVO) { | |
65 | - return invoiceBillOrderService.listAnalysisBy(queryVO); | |
66 | - } | |
67 | - | |
68 | - /** | |
69 | - * 导出分析列表 | |
70 | - * | |
71 | - * @param queryVO 查询条件 | |
72 | - * @return 查询结果 | |
73 | - */ | |
74 | - @PostMapping(value = "/export") | |
75 | - @ApiOperation("导出分析列表") | |
76 | - @AnonymousAccess | |
77 | - public void export(HttpServletResponse response, @RequestBody @Validated InvoiceBillAnalysisVO queryVO) throws IOException, Excel4JException { | |
78 | - invoiceBillOrderService.export(response, queryVO); | |
79 | - } | |
80 | - | |
81 | - /** | |
82 | - * 创建invoice单据 | |
83 | - * | |
84 | - * @param createVO 数据VO | |
85 | - * @return 新增结果 | |
86 | - */ | |
87 | - @PostMapping("/create") | |
88 | - public ServerResult create(@RequestBody InvoiceBillCreateVO createVO) { | |
89 | - return invoiceBillOrderService.create(createVO); | |
90 | - } | |
91 | - | |
92 | - /** | |
93 | - * 获取必须回款日期 | |
94 | - * | |
95 | - * @param createVO 数据VO | |
96 | - * @return 新增结果 | |
97 | - */ | |
98 | - @PostMapping("/get_back_refund_date") | |
99 | - public ServerResult getBackRefundDate(@RequestBody InvoiceBillCreateVO createVO) { | |
100 | - return invoiceBillOrderService.getBackRefundDate(createVO); | |
101 | - } | |
102 | - | |
103 | - /** | |
104 | - * 更新扣款信息 | |
105 | - * | |
106 | - * @param deductInfoVO 数据VO | |
107 | - * @return 编辑结果 | |
108 | - */ | |
109 | - @PostMapping("/update_deduct_info") | |
110 | - public ServerResult updateDeductInfo(@RequestBody InvoiceBillDeductInfoVO deductInfoVO) { | |
111 | - return invoiceBillOrderService.updateDeductInfo(deductInfoVO); | |
112 | - } | |
113 | - | |
114 | - /** | |
115 | - * 更新其他金额信息 | |
116 | - * | |
117 | - * @param amountInfoVO 数据VO | |
118 | - * @return 编辑结果 | |
119 | - */ | |
120 | - @PostMapping("/update_amount_info") | |
121 | - public ServerResult updateAmountInfo(@RequestBody InvoiceBillAmountInfoVO amountInfoVO) { | |
122 | - return invoiceBillOrderService.updateAmountInfo(amountInfoVO); | |
123 | - } | |
124 | - | |
125 | - /** | |
126 | - * 提交审核 | |
127 | - * | |
128 | - * @param commitApplyVO 数据VO | |
129 | - * @return 编辑结果 | |
130 | - */ | |
131 | - @PostMapping("/commit_apply") | |
132 | - public ServerResult commitApply(@RequestBody InvoiceBillCommitApplyVO commitApplyVO) { | |
133 | - return invoiceBillOrderService.commitApply(commitApplyVO); | |
134 | - } | |
135 | - | |
136 | - /** | |
137 | - * 删除数据 | |
138 | - * | |
139 | - * @param invoiceBillOrderQueryVO 查询条件 | |
140 | - * @return 删除是否成功 | |
141 | - */ | |
142 | - @PostMapping("/delete_by_id") | |
143 | - public ServerResult deleteById(@RequestBody InvoiceBillOrderQueryVO invoiceBillOrderQueryVO) { | |
144 | - return invoiceBillOrderService.deleteById(invoiceBillOrderQueryVO); | |
145 | - } | |
146 | - | |
147 | -} | |
148 | - |
src/main/java/com/order/erp/controller/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 String actualRefundDate; | |
43 | - | |
44 | - /** | |
45 | - * 发生扣款金额 | |
46 | - */ | |
47 | - private BigDecimal deductAmount; | |
48 | - /** | |
49 | - * 扣款单url地址 | |
50 | - */ | |
51 | - private String deductUrl; | |
52 | - /** | |
53 | - * 实际应收金额 | |
54 | - */ | |
55 | - private BigDecimal actualReceivableAmount; | |
56 | - /** | |
57 | - * 实际应付金额1 | |
58 | - */ | |
59 | - private BigDecimal actualPayedAmount1; | |
60 | - /** | |
61 | - * 实际应付金额2 | |
62 | - */ | |
63 | - private BigDecimal actualPayedAmount2; | |
64 | - /** | |
65 | - * 实际应付金额3 | |
66 | - */ | |
67 | - private BigDecimal actualPayedAmount3; | |
68 | - /** | |
69 | - * 其他费用金额 | |
70 | - */ | |
71 | - private BigDecimal otherAmount; | |
72 | - /** | |
73 | - * 总经理审核状态 0:待审核、1:审核通过,2:审核驳回 | |
74 | - */ | |
75 | - private Integer status; | |
76 | - | |
77 | -} |
src/main/java/com/order/erp/domain/dto/order/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/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/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 | -import javax.servlet.http.HttpServletResponse; | |
9 | -import java.io.IOException; | |
10 | - | |
11 | -/** | |
12 | - * 应收款账单表(InvoiceBillOrder)表服务接口 | |
13 | - * | |
14 | - * @author makejava | |
15 | - * @since 2024-08-05 16:26:34 | |
16 | - */ | |
17 | -public interface InvoiceBillOrderService extends IService<InvoiceBillOrderDO> { | |
18 | - | |
19 | - /** | |
20 | - * 分页查询 | |
21 | - * | |
22 | - * @param invoiceBillOrderQueryVO 筛选条件 | |
23 | - * @return 查询结果 | |
24 | - */ | |
25 | - ServerResult listByPage(InvoiceBillOrderQueryVO invoiceBillOrderQueryVO); | |
26 | - | |
27 | - /** | |
28 | - * @param queryVO | |
29 | - * @return | |
30 | - */ | |
31 | - ServerResult listBaseOrderInfoBy(InvoiceBaseOrderQueryVO queryVO); | |
32 | - | |
33 | - /** | |
34 | - * @param queryVO | |
35 | - * @return | |
36 | - */ | |
37 | - ServerResult listAnalysisBy(InvoiceBillAnalysisVO queryVO); | |
38 | - | |
39 | - /** | |
40 | - * @param queryVO | |
41 | - * @return | |
42 | - */ | |
43 | - ServerResult export(HttpServletResponse response, InvoiceBillAnalysisVO queryVO) throws IOException; | |
44 | - | |
45 | - /** | |
46 | - * 新增数据 | |
47 | - * | |
48 | - * @param createVO 数据VO | |
49 | - * @return 新增结果 | |
50 | - */ | |
51 | - ServerResult create(InvoiceBillCreateVO createVO); | |
52 | - | |
53 | - /** | |
54 | - * | |
55 | - * @param createVO | |
56 | - * @return | |
57 | - */ | |
58 | - ServerResult getBackRefundDate(InvoiceBillCreateVO createVO); | |
59 | - | |
60 | - /** | |
61 | - * 更新扣款信息 | |
62 | - * | |
63 | - * @param deductInfoVO 数据VO | |
64 | - * @return 编辑结果 | |
65 | - */ | |
66 | - ServerResult updateDeductInfo(InvoiceBillDeductInfoVO deductInfoVO); | |
67 | - | |
68 | - /** | |
69 | - * 更新其他金额信息 | |
70 | - * | |
71 | - * @param amountInfoVO | |
72 | - * @return | |
73 | - */ | |
74 | - ServerResult updateAmountInfo(InvoiceBillAmountInfoVO amountInfoVO); | |
75 | - | |
76 | - /** | |
77 | - * 提交审核 | |
78 | - * | |
79 | - * @param commitApplyVO | |
80 | - * @return | |
81 | - */ | |
82 | - ServerResult commitApply(InvoiceBillCommitApplyVO commitApplyVO); | |
83 | - | |
84 | - /** | |
85 | - * 通过主键删除数据 | |
86 | - * | |
87 | - * @param invoiceBillOrderQueryVO 筛选条件 | |
88 | - * @return 是否成功 | |
89 | - */ | |
90 | - ServerResult deleteById(InvoiceBillOrderQueryVO invoiceBillOrderQueryVO); | |
91 | - | |
92 | -} |
src/main/java/com/order/erp/service/order/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/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/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.alibaba.fastjson.JSONObject; | |
5 | -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | |
6 | -import com.baomidou.mybatisplus.core.metadata.IPage; | |
7 | -import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; | |
8 | -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | |
9 | -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | |
10 | -import com.github.stupdit1t.excel.common.PoiWorkbookType; | |
11 | -import com.github.stupdit1t.excel.core.ExcelHelper; | |
12 | -import com.github.stupdit1t.excel.style.CellPosition; | |
13 | -import com.order.erp.common.constant.Constant; | |
14 | -import com.order.erp.common.constant.ServerResult; | |
15 | -import com.order.erp.common.constant.ServerResultCode; | |
16 | -import com.order.erp.common.exception.BusinessException; | |
17 | -import com.order.erp.common.utils.DateUtils; | |
18 | -import com.order.erp.common.utils.StringUtils; | |
19 | -import com.order.erp.common.utils.TransactionHelper; | |
20 | -import com.order.erp.config.DataScope; | |
21 | -import com.order.erp.domain.ApplyStatusEnum; | |
22 | -import com.order.erp.domain.ApplyTypeEnum; | |
23 | -import com.order.erp.domain.RoleEnum; | |
24 | -import com.order.erp.domain.dto.BaseDO; | |
25 | -import com.order.erp.domain.dto.SystemSettingDO; | |
26 | -import com.order.erp.domain.dto.order.*; | |
27 | -import com.order.erp.domain.vo.order.*; | |
28 | -import com.order.erp.mapper.order.InvoiceBillOrderMapper; | |
29 | -import com.order.erp.service.SystemSettingService; | |
30 | -import com.order.erp.service.order.*; | |
31 | -import lombok.extern.slf4j.Slf4j; | |
32 | -import org.springframework.beans.BeanUtils; | |
33 | -import org.springframework.stereotype.Service; | |
34 | - | |
35 | -import javax.annotation.Resource; | |
36 | -import javax.servlet.http.HttpServletResponse; | |
37 | -import java.io.IOException; | |
38 | -import java.math.BigDecimal; | |
39 | -import java.time.LocalDateTime; | |
40 | -import java.util.*; | |
41 | -import java.util.function.Function; | |
42 | -import java.util.stream.Collectors; | |
43 | - | |
44 | -/** | |
45 | - * 应收款账单表(InvoiceBillOrder)表服务实现类 | |
46 | - * | |
47 | - * @author makejava | |
48 | - * @since 2024-08-05 16:26:34 | |
49 | - */ | |
50 | -@Slf4j | |
51 | -@Service | |
52 | -public class InvoiceBillOrderServiceImpl extends ServiceImpl<InvoiceBillOrderMapper, InvoiceBillOrderDO> implements InvoiceBillOrderService { | |
53 | - | |
54 | - | |
55 | - @Resource | |
56 | - private OrderBaseInfoService orderBaseInfoService; | |
57 | - | |
58 | - @Resource | |
59 | - private OrderProfitAnalysisService profitAnalysisService; | |
60 | - | |
61 | - @Resource | |
62 | - private InvoiceBillMappingService invoiceBillMappingService; | |
63 | - | |
64 | - @Resource | |
65 | - private OrderFieldLockApplyService orderFieldLockApplyService; | |
66 | - | |
67 | - @Resource | |
68 | - private SystemSettingService systemSettingService; | |
69 | - | |
70 | - @Resource | |
71 | - private DataScope dataScope; | |
72 | - | |
73 | - @Resource | |
74 | - private TransactionHelper transactionHelper; | |
75 | - | |
76 | - | |
77 | - /** | |
78 | - * 分页查询 | |
79 | - * | |
80 | - * @param queryVO 筛选条件 | |
81 | - * @return 查询结果 | |
82 | - */ | |
83 | - @Override | |
84 | - public ServerResult listByPage(InvoiceBillOrderQueryVO queryVO) { | |
85 | - LambdaQueryWrapper<InvoiceBillOrderDO> queryWrapper = getQueryWrapper(queryVO); | |
86 | - Page page = new Page<>(queryVO.getPage(), queryVO.getPageSize()); | |
87 | - IPage<InvoiceBillOrderDO> iPage = page(page, queryWrapper); | |
88 | - return ServerResult.success(iPage); | |
89 | - } | |
90 | - | |
91 | - /** | |
92 | - * @param queryVO | |
93 | - * @return | |
94 | - */ | |
95 | - private LambdaQueryWrapper<InvoiceBillOrderDO> getQueryWrapper(InvoiceBillOrderQueryVO queryVO) { | |
96 | - LambdaQueryWrapper<InvoiceBillOrderDO> queryWrapper = new LambdaQueryWrapper<InvoiceBillOrderDO>() | |
97 | - .eq(InvoiceBillOrderDO::getEnableFlag, Constant.ENABLE_TEN) | |
98 | - .eq(StringUtils.isNotBlank(queryVO.getInvoiceNo()), InvoiceBillOrderDO::getInvoiceNo, queryVO.getInvoiceNo()) | |
99 | - .eq(Objects.nonNull(queryVO.getStatus()), InvoiceBillOrderDO::getStatus, queryVO.getStatus()) | |
100 | - .ge(StringUtils.isNotBlank(queryVO.getStartTime()), InvoiceBillOrderDO::getCreateTime, queryVO.getStartTime()) | |
101 | - .le(StringUtils.isNotBlank(queryVO.getEndTime()), InvoiceBillOrderDO::getCreateTime, queryVO.getEndTime()) | |
102 | - .orderByDesc(InvoiceBillOrderDO::getId); | |
103 | - if (CollectionUtils.isNotEmpty(queryVO.getIds())) { | |
104 | - queryWrapper.in(InvoiceBillOrderDO::getId, queryVO.getIds()); | |
105 | - } else { | |
106 | - Set<Long> billOrderIds = filterBillOrderIdsBy(queryVO); | |
107 | - queryWrapper.in(CollectionUtils.isNotEmpty(billOrderIds), InvoiceBillOrderDO::getId, billOrderIds); | |
108 | - } | |
109 | - return queryWrapper; | |
110 | - } | |
111 | - | |
112 | - @Override | |
113 | - public ServerResult listBaseOrderInfoBy(InvoiceBaseOrderQueryVO queryVO) { | |
114 | - List<InvoiceBillMappingDO> mappingDOS = invoiceBillMappingService.list(new LambdaQueryWrapper<InvoiceBillMappingDO>() | |
115 | - .eq(BaseDO::getEnableFlag, Constant.ENABLE_TEN) | |
116 | - .eq(InvoiceBillMappingDO::getInvoiceNo, queryVO.getInvoiceNo())); | |
117 | - if (CollectionUtils.isEmpty(mappingDOS)) { | |
118 | - return ServerResult.success(); | |
119 | - } | |
120 | - Set<Long> orderIds = mappingDOS.stream().map(InvoiceBillMappingDO::getOrderId).collect(Collectors.toSet()); | |
121 | - return ServerResult.success(orderBaseInfoService.listByIds(orderIds)); | |
122 | - } | |
123 | - | |
124 | - @Override | |
125 | - public ServerResult listAnalysisBy(InvoiceBillAnalysisVO queryVO) { | |
126 | - return ServerResult.success(getAnalysisResult(queryVO)); | |
127 | - } | |
128 | - | |
129 | - @Override | |
130 | - public ServerResult export(HttpServletResponse response, InvoiceBillAnalysisVO queryVO) throws IOException { | |
131 | - InvoiceBillAnalysisResultVO resultVO = getAnalysisResult(queryVO); | |
132 | - if (Objects.isNull(resultVO)) { | |
133 | - throw new BusinessException("数据为空,不能导出!"); | |
134 | - } | |
135 | - List<Map<String, Object>> list = buildExportMapVOS(resultVO); | |
136 | - if (CollectionUtils.isNotEmpty(list)) { | |
137 | - List<String> keys = new ArrayList<>(list.get(Constant.ZERO).keySet()); | |
138 | - | |
139 | - ExcelHelper.opsExport(PoiWorkbookType.XLSX) | |
140 | - .opsSheet(list) | |
141 | - .opsHeader().simple().texts(keys).done() | |
142 | - .opsColumn().fields(keys).done() | |
143 | - .height(CellPosition.CELL, 750) | |
144 | - .done() | |
145 | - .export(response.getOutputStream()); | |
146 | - } | |
147 | - return ServerResult.success(); | |
148 | - } | |
149 | - | |
150 | - /** | |
151 | - * @param resultVO | |
152 | - * @return | |
153 | - */ | |
154 | - private List<Map<String, Object>> buildExportMapVOS(InvoiceBillAnalysisResultVO resultVO) throws IOException { | |
155 | - List<InvoiceBillAnalysisExportVO> exportVOS = resultVO.getExportVOS(); | |
156 | - List<Map<String, Object>> list = new ArrayList<>(); | |
157 | - int i = 0; | |
158 | - for (InvoiceBillAnalysisExportVO exportVO : exportVOS) { | |
159 | - Map<String, Object> map = new LinkedHashMap<>(); | |
160 | - map.put("编号", i++); | |
161 | - map.put("客户编码", exportVO.getCustomerCode()); | |
162 | - map.put("INVOICE编码", exportVO.getInvoiceNo()); | |
163 | - map.put("客户总金额汇总", exportVO.getCustomerTotalPrice()); | |
164 | - map.put("客户扣款金额汇总", exportVO.getDeductAmount()); | |
165 | - map.put("实际应收金额", exportVO.getActualReceivableAmount()); | |
166 | - map.put("实际收款金额汇总", exportVO.getActualPayedAmount()); | |
167 | - map.put("其他费用金额汇总", exportVO.getOtherAmount()); | |
168 | - map.put("其他费用合计", exportVO.getOtherTotalAmount()); | |
169 | - map.put("必须回款日期", exportVO.getBackRefundDate()); | |
170 | - map.put("实际回款日期", exportVO.getActualRefundDate()); | |
171 | - list.add(map); | |
172 | - } | |
173 | - Map<String, Object> map = new LinkedHashMap<>(); | |
174 | - map.put("编号", "合计"); | |
175 | - map.put("客户编码", ""); | |
176 | - map.put("INVOICE编码", ""); | |
177 | - map.put("客户总金额汇总", resultVO.getCustomerTotalPrice()); | |
178 | - map.put("客户扣款金额汇总", resultVO.getDeductAmount()); | |
179 | - map.put("实际应收金额", resultVO.getActualReceivableAmount()); | |
180 | - map.put("实际收款金额汇总", resultVO.getActualPayedAmount()); | |
181 | - map.put("其他费用金额汇总", resultVO.getOtherAmount()); | |
182 | - map.put("其他费用合计", resultVO.getOtherTotalAmount()); | |
183 | - map.put("必须回款日期", ""); | |
184 | - map.put("实际回款日期", ""); | |
185 | - list.add(map); | |
186 | - return list; | |
187 | - } | |
188 | - | |
189 | - /** | |
190 | - * @param queryVO | |
191 | - * @return | |
192 | - */ | |
193 | - private InvoiceBillAnalysisResultVO getAnalysisResult(InvoiceBillAnalysisVO queryVO) { | |
194 | - LambdaQueryWrapper<InvoiceBillOrderDO> queryWrapper = getQueryWrapper(queryVO); | |
195 | - List<InvoiceBillOrderDO> invoiceBillOrderDOS = list(queryWrapper); | |
196 | - if (CollectionUtils.isEmpty(invoiceBillOrderDOS)) { | |
197 | - return null; | |
198 | - } | |
199 | - Set<Long> ids = invoiceBillOrderDOS.stream().map(InvoiceBillOrderDO::getId).collect(Collectors.toSet()); | |
200 | - List<InvoiceBillMappingDO> invoiceBillMappingDOS = invoiceBillMappingService.list(new LambdaQueryWrapper<InvoiceBillMappingDO>().eq(BaseDO::getEnableFlag, Constant.ENABLE_TEN).in(InvoiceBillMappingDO::getInvoiceBillId, ids)); | |
201 | - if (CollectionUtils.isEmpty(invoiceBillMappingDOS)) { | |
202 | - return null; | |
203 | - } | |
204 | - Map<Long, InvoiceBillMappingDO> orderBillMap = invoiceBillMappingDOS.stream().collect(Collectors.toMap(InvoiceBillMappingDO::getOrderId, Function.identity(), (x, y) -> x)); | |
205 | - List<InvoiceOrderBaseItemVO> itemVOS = getInvoiceOrderBaseItems(orderBillMap); | |
206 | - Map<String, InvoiceBillOrderDO> invoiceBillOrderDOMap = invoiceBillOrderDOS.stream().collect(Collectors.toMap(InvoiceBillOrderDO::getInvoiceNo, Function.identity(), (x, y) -> x)); | |
207 | - Map<String, List<InvoiceOrderBaseItemVO>> baseItemMap = itemVOS.stream().collect(Collectors.groupingBy(InvoiceOrderBaseItemVO::getInvoiceCode)); | |
208 | - List<InvoiceBillAnalysisExportVO> exportVOS = wrapperAnalysisExport(invoiceBillOrderDOMap, baseItemMap); | |
209 | - return wrapperAnalysisResultVO(exportVOS); | |
210 | - } | |
211 | - | |
212 | - /** | |
213 | - * @param exportVOS | |
214 | - * @return | |
215 | - */ | |
216 | - private InvoiceBillAnalysisResultVO wrapperAnalysisResultVO(List<InvoiceBillAnalysisExportVO> exportVOS) { | |
217 | - if (CollectionUtils.isEmpty(exportVOS)) { | |
218 | - return null; | |
219 | - } | |
220 | - InvoiceBillAnalysisResultVO resultVO = InvoiceBillAnalysisResultVO.builder().exportVOS(exportVOS).build(); | |
221 | - BigDecimal customerTotalPrice = new BigDecimal(Constant.ZERO); | |
222 | - BigDecimal deductAmount = new BigDecimal(Constant.ZERO); | |
223 | - BigDecimal actualReceivableAmount = new BigDecimal(Constant.ZERO); | |
224 | - BigDecimal actualPayedAmount = new BigDecimal(Constant.ZERO); | |
225 | - BigDecimal otherAmount = new BigDecimal(Constant.ZERO); | |
226 | - BigDecimal otherTotalAmount = new BigDecimal(Constant.ZERO); | |
227 | - for (InvoiceBillAnalysisExportVO exportVO : exportVOS) { | |
228 | - if (Objects.nonNull(exportVO.getCustomerTotalPrice())) { | |
229 | - customerTotalPrice = customerTotalPrice.add(exportVO.getCustomerTotalPrice()); | |
230 | - } | |
231 | - if (Objects.nonNull(exportVO.getDeductAmount())) { | |
232 | - deductAmount = deductAmount.add(exportVO.getDeductAmount()); | |
233 | - } | |
234 | - if (Objects.nonNull(exportVO.getActualReceivableAmount())) { | |
235 | - actualReceivableAmount = actualReceivableAmount.add(exportVO.getActualReceivableAmount()); | |
236 | - } | |
237 | - if (Objects.nonNull(exportVO.getActualPayedAmount())) { | |
238 | - actualPayedAmount = actualPayedAmount.add(exportVO.getActualPayedAmount()); | |
239 | - } | |
240 | - if (Objects.nonNull(exportVO.getOtherAmount())) { | |
241 | - otherAmount = customerTotalPrice.add(exportVO.getOtherAmount()); | |
242 | - } | |
243 | - if (Objects.nonNull(exportVO.getOtherTotalAmount())) { | |
244 | - otherTotalAmount = otherTotalAmount.add(exportVO.getOtherTotalAmount()); | |
245 | - } | |
246 | - } | |
247 | - resultVO.setCustomerTotalPrice(customerTotalPrice); | |
248 | - resultVO.setDeductAmount(deductAmount); | |
249 | - resultVO.setActualReceivableAmount(actualReceivableAmount); | |
250 | - resultVO.setActualPayedAmount(actualPayedAmount); | |
251 | - resultVO.setOtherAmount(otherAmount); | |
252 | - resultVO.setOtherTotalAmount(otherTotalAmount); | |
253 | - return resultVO; | |
254 | - } | |
255 | - | |
256 | - /** | |
257 | - * @param invoiceBillOrderDOMap | |
258 | - * @param baseItemMap | |
259 | - * @return | |
260 | - */ | |
261 | - private List<InvoiceBillAnalysisExportVO> wrapperAnalysisExport(Map<String, InvoiceBillOrderDO> invoiceBillOrderDOMap, Map<String, List<InvoiceOrderBaseItemVO>> baseItemMap) { | |
262 | - if (CollectionUtils.isEmpty(invoiceBillOrderDOMap)) { | |
263 | - return Collections.emptyList(); | |
264 | - } | |
265 | - List<InvoiceBillAnalysisExportVO> results = new ArrayList<>(); | |
266 | - for (Map.Entry<String, InvoiceBillOrderDO> entry : invoiceBillOrderDOMap.entrySet()) { | |
267 | - InvoiceBillOrderDO invoiceBillOrderDO = entry.getValue(); | |
268 | - List<InvoiceBillAnalysisExportVO> exportVOS = transfer2analysisExportVO(invoiceBillOrderDO, baseItemMap); | |
269 | - if (CollectionUtils.isNotEmpty(exportVOS)) { | |
270 | - results.addAll(exportVOS); | |
271 | - } | |
272 | - } | |
273 | - return results; | |
274 | - } | |
275 | - | |
276 | - /** | |
277 | - * @param invoiceBillOrderDO | |
278 | - * @param baseItemMap | |
279 | - * @return | |
280 | - */ | |
281 | - private List<InvoiceBillAnalysisExportVO> transfer2analysisExportVO(InvoiceBillOrderDO invoiceBillOrderDO, Map<String, List<InvoiceOrderBaseItemVO>> baseItemMap) { | |
282 | - List<InvoiceBillAnalysisExportVO> results = new ArrayList<>(); | |
283 | - String invoiceNo = invoiceBillOrderDO.getInvoiceNo(); | |
284 | - if (baseItemMap.containsKey(invoiceNo)) { | |
285 | - List<InvoiceOrderBaseItemVO> baseItemVOS = baseItemMap.get(invoiceNo); | |
286 | - Map<String, List<InvoiceOrderBaseItemVO>> listMap = baseItemVOS.stream().collect(Collectors.groupingBy(InvoiceOrderBaseItemVO::getCustomerCode)); | |
287 | - for (Map.Entry<String, List<InvoiceOrderBaseItemVO>> entry : listMap.entrySet()) { | |
288 | - String customerCode = entry.getKey(); | |
289 | - List<InvoiceOrderBaseItemVO> itemVOS = entry.getValue(); | |
290 | - InvoiceBillAnalysisExportVO exportVO = buildAnalysisExportVO(invoiceBillOrderDO); | |
291 | - exportVO.setCustomerCode(customerCode); | |
292 | - if (CollectionUtils.isEmpty(itemVOS)) { | |
293 | - exportVO.setCustomerTotalPrice(new BigDecimal(Constant.ZERO)); | |
294 | - } else { | |
295 | - BigDecimal customerTotalPrice = new BigDecimal(Constant.ZERO); | |
296 | - for (InvoiceOrderBaseItemVO itemVO : itemVOS) { | |
297 | - customerTotalPrice = customerTotalPrice.add(Objects.nonNull(itemVO.getCustomerTotalPrice()) ? itemVO.getCustomerTotalPrice() : new BigDecimal(Constant.ZERO)); | |
298 | - } | |
299 | - exportVO.setCustomerTotalPrice(customerTotalPrice); | |
300 | - } | |
301 | - results.add(exportVO); | |
302 | - } | |
303 | - } | |
304 | - return results; | |
305 | - } | |
306 | - | |
307 | - /** | |
308 | - * @param invoiceBillOrderDO | |
309 | - * @return | |
310 | - */ | |
311 | - private InvoiceBillAnalysisExportVO buildAnalysisExportVO(InvoiceBillOrderDO invoiceBillOrderDO) { | |
312 | - InvoiceBillAnalysisExportVO exportVO = new InvoiceBillAnalysisExportVO(); | |
313 | - BeanUtils.copyProperties(invoiceBillOrderDO, exportVO); | |
314 | - BigDecimal actualPayedAmount = new BigDecimal(Constant.ZERO); | |
315 | - if (Objects.nonNull(invoiceBillOrderDO.getActualPayedAmount1())) { | |
316 | - actualPayedAmount = actualPayedAmount.add(invoiceBillOrderDO.getActualPayedAmount1()); | |
317 | - } | |
318 | - if (Objects.nonNull(invoiceBillOrderDO.getActualPayedAmount2())) { | |
319 | - actualPayedAmount = actualPayedAmount.add(invoiceBillOrderDO.getActualPayedAmount2()); | |
320 | - } | |
321 | - if (Objects.nonNull(invoiceBillOrderDO.getActualPayedAmount3())) { | |
322 | - actualPayedAmount = actualPayedAmount.add(invoiceBillOrderDO.getActualPayedAmount3()); | |
323 | - } | |
324 | - exportVO.setActualPayedAmount(actualPayedAmount); | |
325 | - BigDecimal otherAmount = (Objects.nonNull(invoiceBillOrderDO.getActualReceivableAmount()) ? invoiceBillOrderDO.getActualReceivableAmount() : new BigDecimal(Constant.ZERO)) | |
326 | - .subtract(exportVO.getActualPayedAmount()); | |
327 | - exportVO.setOtherAmount(otherAmount); | |
328 | - BigDecimal otherTotalAmount = (Objects.nonNull(invoiceBillOrderDO.getActualReceivableAmount()) ? invoiceBillOrderDO.getActualReceivableAmount() : new BigDecimal(Constant.ZERO)) | |
329 | - .subtract(exportVO.getActualPayedAmount()).subtract(otherAmount); | |
330 | - exportVO.setOtherTotalAmount(otherTotalAmount); | |
331 | - return exportVO; | |
332 | - } | |
333 | - | |
334 | - /** | |
335 | - * @param mappingDOMap | |
336 | - * @return | |
337 | - */ | |
338 | - private List<InvoiceOrderBaseItemVO> getInvoiceOrderBaseItems(Map<Long, InvoiceBillMappingDO> mappingDOMap) { | |
339 | - Set<Long> orderIds = mappingDOMap.keySet(); | |
340 | - List<OrderBaseInfoDO> orderBaseInfoDOList = orderBaseInfoService.listByIds(orderIds); | |
341 | - List<OrderProfitAnalysisDO> profitAnalysisDOS = profitAnalysisService.list(new LambdaQueryWrapper<OrderProfitAnalysisDO>().eq(BaseDO::getEnableFlag, Constant.ENABLE_TEN).in(OrderProfitAnalysisDO::getOrderId, orderIds)); | |
342 | - Map<Long, OrderBaseInfoDO> orderBaseInfoDOMap = orderBaseInfoDOList.stream().collect(Collectors.toMap(OrderBaseInfoDO::getId, Function.identity(), (x, y) -> x)); | |
343 | - Map<Long, OrderProfitAnalysisDO> profitAnalysisDOMap = profitAnalysisDOS.stream().collect(Collectors.toMap(OrderProfitAnalysisDO::getOrderId, Function.identity(), (x, y) -> x)); | |
344 | - List<InvoiceOrderBaseItemVO> baseItemVOS = new ArrayList<>(); | |
345 | - for (Map.Entry<Long, OrderBaseInfoDO> entry : orderBaseInfoDOMap.entrySet()) { | |
346 | - Long orderId = entry.getKey(); | |
347 | - OrderBaseInfoDO baseInfoDO = entry.getValue(); | |
348 | - InvoiceOrderBaseItemVO itemVO = InvoiceOrderBaseItemVO.builder() | |
349 | - .orderId(orderId) | |
350 | - .customerCode(baseInfoDO.getCustomerCode()) | |
351 | - .build(); | |
352 | - if (profitAnalysisDOMap.containsKey(orderId)) { | |
353 | - OrderProfitAnalysisDO profitAnalysisDO = profitAnalysisDOMap.get(orderId); | |
354 | - itemVO.setCustomerTotalPrice(Objects.isNull(profitAnalysisDO.getCustomerTotalPrice()) ? new BigDecimal(Constant.ZERO) : new BigDecimal(profitAnalysisDO.getCustomerTotalPrice())); | |
355 | - } else { | |
356 | - itemVO.setCustomerTotalPrice(new BigDecimal(Constant.ZERO)); | |
357 | - } | |
358 | - | |
359 | - if (mappingDOMap.containsKey(orderId)) { | |
360 | - InvoiceBillMappingDO mappingDO = mappingDOMap.get(orderId); | |
361 | - itemVO.setInvoiceCode(mappingDO.getInvoiceNo()); | |
362 | - } | |
363 | - baseItemVOS.add(itemVO); | |
364 | - } | |
365 | - return baseItemVOS; | |
366 | - } | |
367 | - | |
368 | - /** | |
369 | - * @param queryVO | |
370 | - * @return | |
371 | - */ | |
372 | - private Set<Long> filterBillOrderIdsBy(InvoiceBillOrderQueryVO queryVO) { | |
373 | - List<Long> orderIds = filterOrderIdsBy(queryVO); | |
374 | - if (CollectionUtils.isEmpty(orderIds)) { | |
375 | - return null; | |
376 | - } | |
377 | - List<InvoiceBillMappingDO> mappingDOS = invoiceBillMappingService.list(new LambdaQueryWrapper<InvoiceBillMappingDO>().eq(BaseDO::getEnableFlag, Constant.ENABLE_TEN) | |
378 | - .in(CollectionUtils.isNotEmpty(orderIds), InvoiceBillMappingDO::getOrderId, orderIds)); | |
379 | - if (CollectionUtils.isEmpty(mappingDOS)) { | |
380 | - Set<Long> ids = new HashSet<>(); | |
381 | - ids.add(-1L); | |
382 | - return ids; | |
383 | - } | |
384 | - return mappingDOS.stream().map(InvoiceBillMappingDO::getInvoiceBillId).collect(Collectors.toSet()); | |
385 | - } | |
386 | - | |
387 | - /** | |
388 | - * @param queryVO | |
389 | - * @return | |
390 | - */ | |
391 | - private List<Long> filterOrderIdsBy(InvoiceBillOrderQueryVO queryVO) { | |
392 | - Boolean flag = false; | |
393 | - if (StringUtils.isNotBlank(queryVO.getCustomerCode())) { | |
394 | - flag = flag | true; | |
395 | - } | |
396 | - if (StringUtils.isNotBlank(queryVO.getProductionDepartment())) { | |
397 | - flag = flag | true; | |
398 | - } | |
399 | - if (StringUtils.isNotBlank(queryVO.getCustomerPo())) { | |
400 | - flag = flag | true; | |
401 | - } | |
402 | - if (StringUtils.isNotBlank(queryVO.getInnerNo())) { | |
403 | - flag = flag | true; | |
404 | - } | |
405 | - if (StringUtils.isNotBlank(queryVO.getProjectNo())) { | |
406 | - flag = flag | true; | |
407 | - } | |
408 | - if (!flag) { | |
409 | - return null; | |
410 | - } | |
411 | - LambdaQueryWrapper<OrderBaseInfoDO> queryWrapper = new LambdaQueryWrapper<OrderBaseInfoDO>() | |
412 | - .eq(OrderBaseInfoDO::getEnableFlag, Constant.ENABLE_TEN) | |
413 | - .eq(StringUtils.isNotBlank(queryVO.getCustomerCode()), OrderBaseInfoDO::getCustomerCode, queryVO.getCustomerCode()) | |
414 | - .eq(StringUtils.isNotBlank(queryVO.getProductionDepartment()), OrderBaseInfoDO::getProductionDepartment, queryVO.getProductionDepartment()) | |
415 | - .eq(StringUtils.isNotBlank(queryVO.getCustomerPo()), OrderBaseInfoDO::getCustomerPo, queryVO.getCustomerPo()) | |
416 | - .eq(StringUtils.isNotBlank(queryVO.getInnerNo()), OrderBaseInfoDO::getInnerNo, queryVO.getInnerNo()) | |
417 | - .eq(StringUtils.isNotBlank(queryVO.getProjectNo()), OrderBaseInfoDO::getProjectNo, queryVO.getProjectNo()); | |
418 | - List<OrderBaseInfoDO> orderBaseInfoDOList = orderBaseInfoService.list(queryWrapper); | |
419 | - if (CollectionUtils.isEmpty(orderBaseInfoDOList)) { | |
420 | - List<Long> orderIds = new ArrayList<>(); | |
421 | - orderIds.add(-1L); | |
422 | - return orderIds; | |
423 | - } | |
424 | - return orderBaseInfoDOList.stream().map(OrderBaseInfoDO::getId).collect(Collectors.toList()); | |
425 | - } | |
426 | - | |
427 | - /** | |
428 | - * 创建invoice单据 | |
429 | - * | |
430 | - * @param createVO 实例对象 | |
431 | - * @return 实例对象 | |
432 | - */ | |
433 | - @Override | |
434 | - public ServerResult create(InvoiceBillCreateVO createVO) { | |
435 | - if (Objects.nonNull(createVO.getId())) { | |
436 | - createVO.setId(null); | |
437 | - } | |
438 | - | |
439 | - validaBillOrder(createVO); | |
440 | - | |
441 | - InvoiceBillOrderDO invoiceBillOrderDO = buildInvoiceBillOrderDO(createVO); | |
442 | - | |
443 | - transactionHelper.run(() -> { | |
444 | - save(invoiceBillOrderDO); | |
445 | - | |
446 | - invoiceBillMappingService.saveBatch(buildInvoiceBillMappingDOS(createVO, invoiceBillOrderDO)); | |
447 | - }); | |
448 | - | |
449 | - return ServerResult.success(); | |
450 | - } | |
451 | - | |
452 | - @Override | |
453 | - public ServerResult getBackRefundDate(InvoiceBillCreateVO createVO) { | |
454 | - List<OrderBaseInfoDO> orderBaseInfoDOList = orderBaseInfoService.listByIds(createVO.getOrderIds()); | |
455 | - if (CollectionUtils.isEmpty(orderBaseInfoDOList)) { | |
456 | - throw new BusinessException("勾选的订单信息不存在!"); | |
457 | - } | |
458 | - | |
459 | - InvoiceHoldTimeItemVO invoiceHoldTimeItemVO = getCustomerHoldTime(orderBaseInfoDOList); | |
460 | - | |
461 | - return ServerResult.success(calculateBackRefundDate(invoiceHoldTimeItemVO)); | |
462 | - } | |
463 | - | |
464 | - /** | |
465 | - * @param invoiceHoldTimeItemVO | |
466 | - * @return | |
467 | - */ | |
468 | - private String calculateBackRefundDate(InvoiceHoldTimeItemVO invoiceHoldTimeItemVO) { | |
469 | - Integer holdDays = getHoldTimeByCustomerCode(invoiceHoldTimeItemVO.getCustomerCode()); | |
470 | - LocalDateTime holdTime = DateUtils.parse(invoiceHoldTimeItemVO.getHoldTime(), DateUtils.DATE_TIME).plusDays(holdDays); | |
471 | - return DateUtils.format(holdTime, DateUtils.DATE); | |
472 | - } | |
473 | - | |
474 | - /** | |
475 | - * @param customerCode | |
476 | - * @return | |
477 | - */ | |
478 | - private Integer getHoldTimeByCustomerCode(String customerCode) { | |
479 | - SystemSettingDO systemSettingDO = systemSettingService.getOne(new LambdaQueryWrapper<SystemSettingDO>().eq(BaseDO::getEnableFlag, Constant.ENABLE_TEN) | |
480 | - .eq(SystemSettingDO::getSettingCode, "customerCode").eq(SystemSettingDO::getSettingValue, customerCode) | |
481 | - .eq(SystemSettingDO::getRelationCode, "orderHodTime").last("limit 1")); | |
482 | - if (Objects.isNull(systemSettingDO)) { | |
483 | - return Constant.ZERO; | |
484 | - } | |
485 | - String holdTime = systemSettingDO.getRelationValue(); | |
486 | - return StringUtils.isBlank(holdTime) ? Constant.ZERO : Integer.parseInt(holdTime); | |
487 | - } | |
488 | - | |
489 | - /** | |
490 | - * @param orderBaseInfoDOList | |
491 | - * @return | |
492 | - */ | |
493 | - private InvoiceHoldTimeItemVO getCustomerHoldTime(List<OrderBaseInfoDO> orderBaseInfoDOList) { | |
494 | - if (CollectionUtils.isEmpty(orderBaseInfoDOList)) { | |
495 | - return null; | |
496 | - } | |
497 | - | |
498 | - Map<String, OrderBaseInfoDO> holdTimeMap = new HashMap<String, OrderBaseInfoDO>(); | |
499 | - String maxHoldTime = null; | |
500 | - for (OrderBaseInfoDO baseInfoDO : orderBaseInfoDOList) { | |
501 | - if (StringUtils.isNotBlank(baseInfoDO.getOrderHodTime())) { | |
502 | - holdTimeMap.put(baseInfoDO.getOrderHodTime(), baseInfoDO); | |
503 | - if (StringUtils.isBlank(maxHoldTime)) { | |
504 | - maxHoldTime = baseInfoDO.getOrderHodTime(); | |
505 | - } else if (maxHoldTime.compareTo(baseInfoDO.getOrderHodTime()) <= 0) { | |
506 | - maxHoldTime = baseInfoDO.getOrderHodTime(); | |
507 | - } | |
508 | - } | |
509 | - } | |
510 | - if (StringUtils.isBlank(maxHoldTime)) { | |
511 | - return null; | |
512 | - } | |
513 | - InvoiceHoldTimeItemVO itemVO = new InvoiceHoldTimeItemVO(); | |
514 | - if (holdTimeMap.containsKey(maxHoldTime)) { | |
515 | - OrderBaseInfoDO baseInfoDO = holdTimeMap.get(maxHoldTime); | |
516 | - itemVO.setCustomerCode(baseInfoDO.getCustomerCode()); | |
517 | - itemVO.setHoldTime(maxHoldTime); | |
518 | - itemVO.setBaseInfoDO(baseInfoDO); | |
519 | - } | |
520 | - return itemVO; | |
521 | - } | |
522 | - | |
523 | - /** | |
524 | - * @param createVO | |
525 | - * @return | |
526 | - */ | |
527 | - private InvoiceBillOrderDO buildInvoiceBillOrderDO(InvoiceBillCreateVO createVO) { | |
528 | - return InvoiceBillOrderDO.builder() | |
529 | - .invoiceNo(createVO.getInvoiceNo()) | |
530 | - .bgUrl(createVO.getBgUrl()) | |
531 | - .backRefundDate(createVO.getBackRefundDate()) | |
532 | - .status(ApplyStatusEnum.NO_COMMIT.getStatus()) | |
533 | - .build(); | |
534 | - } | |
535 | - | |
536 | - /** | |
537 | - * @param createVO | |
538 | - * @param invoiceBillOrderDO | |
539 | - * @return | |
540 | - */ | |
541 | - private List<InvoiceBillMappingDO> buildInvoiceBillMappingDOS(InvoiceBillCreateVO createVO, InvoiceBillOrderDO invoiceBillOrderDO) { | |
542 | - return createVO.getOrderIds().stream().map(x -> { | |
543 | - return InvoiceBillMappingDO.builder() | |
544 | - .orderId(x) | |
545 | - .invoiceBillId(invoiceBillOrderDO.getId()) | |
546 | - .invoiceNo(invoiceBillOrderDO.getInvoiceNo()) | |
547 | - .build(); | |
548 | - }).collect(Collectors.toList()); | |
549 | - } | |
550 | - | |
551 | - /** | |
552 | - * @param createVO | |
553 | - */ | |
554 | - private void validaBillOrder(InvoiceBillCreateVO createVO) { | |
555 | - if (CollectionUtils.isEmpty(createVO.getOrderIds())) { | |
556 | - throw new BusinessException("请勾选订单!"); | |
557 | - } | |
558 | - | |
559 | - List<OrderBaseInfoDO> orderBaseInfoDOList = orderBaseInfoService.listByIds(createVO.getOrderIds()); | |
560 | - if (CollectionUtils.isEmpty(orderBaseInfoDOList)) { | |
561 | - throw new BusinessException("勾选的订单信息不存在!"); | |
562 | - } | |
563 | - | |
564 | - if (orderBaseInfoDOList.size() != createVO.getOrderIds().size()) { | |
565 | - throw new BusinessException("勾选的订单信息有误!"); | |
566 | - } | |
567 | - | |
568 | - String invoiceNo = createVO.getInvoiceNo(); | |
569 | - | |
570 | - List<InvoiceBillOrderDO> invoiceBillOrderDOS = list(new LambdaQueryWrapper<InvoiceBillOrderDO>() | |
571 | - .eq(BaseDO::getEnableFlag, Constant.ENABLE_TEN) | |
572 | - .eq(InvoiceBillOrderDO::getInvoiceNo, invoiceNo)); | |
573 | - if (CollectionUtils.isNotEmpty(invoiceBillOrderDOS)) { | |
574 | - throw new BusinessException("存在相同的invoice订单!"); | |
575 | - } | |
576 | - | |
577 | - List<InvoiceBillMappingDO> invoiceBillMappingDOList = invoiceBillMappingService.list(new LambdaQueryWrapper<InvoiceBillMappingDO>().eq(BaseDO::getEnableFlag, Constant.ENABLE_TEN).in(InvoiceBillMappingDO::getOrderId, createVO.getOrderIds())); | |
578 | - if (CollectionUtils.isNotEmpty(invoiceBillMappingDOList)) { | |
579 | - throw new BusinessException("该勾选的订单已经绑定其他账单了!"); | |
580 | - } | |
581 | - } | |
582 | - | |
583 | - /** | |
584 | - * 修改数据 | |
585 | - * | |
586 | - * @param deductInfoVO 实例对象 | |
587 | - * @return 实例对象 | |
588 | - */ | |
589 | - @Override | |
590 | - public ServerResult updateDeductInfo(InvoiceBillDeductInfoVO deductInfoVO) { | |
591 | - if (Objects.isNull(deductInfoVO.getId())) { | |
592 | - throw new BusinessException("id 不能为空"); | |
593 | - } | |
594 | - InvoiceBillOrderDO invoiceBillOrderDo = getById(deductInfoVO.getId()); | |
595 | - if (Objects.isNull(invoiceBillOrderDo)) { | |
596 | - throw new BusinessException("应收款单据不存在"); | |
597 | - } | |
598 | - | |
599 | - checkCommitApply(invoiceBillOrderDo.getId()); | |
600 | - | |
601 | - invoiceBillOrderDo.setDeductUrl(deductInfoVO.getDeductUrl()); | |
602 | - invoiceBillOrderDo.setDeductAmount(deductInfoVO.getDeductAmount()); | |
603 | - updateById(invoiceBillOrderDo); | |
604 | - return ServerResult.success(); | |
605 | - } | |
606 | - | |
607 | - @Override | |
608 | - public ServerResult updateAmountInfo(InvoiceBillAmountInfoVO amountInfoVO) { | |
609 | - if (Objects.isNull(amountInfoVO.getId())) { | |
610 | - throw new BusinessException("id 不能为空"); | |
611 | - } | |
612 | - InvoiceBillOrderDO invoiceBillOrderDo = getById(amountInfoVO.getId()); | |
613 | - if (Objects.isNull(invoiceBillOrderDo)) { | |
614 | - throw new BusinessException("应收款单据不存在"); | |
615 | - } | |
616 | - | |
617 | - checkCommitApply(invoiceBillOrderDo.getId()); | |
618 | - | |
619 | - invoiceBillOrderDo.setBgUrl(amountInfoVO.getBgUrl()); | |
620 | - invoiceBillOrderDo.setActualReceivableAmount(amountInfoVO.getActualReceivableAmount()); | |
621 | - invoiceBillOrderDo.setActualPayedAmount1(amountInfoVO.getActualPayedAmount1()); | |
622 | - invoiceBillOrderDo.setActualPayedAmount2(amountInfoVO.getActualPayedAmount2()); | |
623 | - invoiceBillOrderDo.setActualPayedAmount3(amountInfoVO.getActualPayedAmount3()); | |
624 | - invoiceBillOrderDo.setOtherAmount(amountInfoVO.getOtherAmount()); | |
625 | - updateById(invoiceBillOrderDo); | |
626 | - return ServerResult.success(); | |
627 | - } | |
628 | - | |
629 | - /** | |
630 | - * @param id | |
631 | - */ | |
632 | - private void checkCommitApply(Long id) { | |
633 | - OrderFieldLockApplyDO applyDO = orderFieldLockApplyService.getOne(new LambdaQueryWrapper<OrderFieldLockApplyDO>() | |
634 | - .eq(OrderFieldLockApplyDO::getEnableFlag, Constant.ENABLE_TEN) | |
635 | - .eq(OrderFieldLockApplyDO::getStatus, ApplyStatusEnum.WAIT_AUDIT.getStatus()) | |
636 | - .eq(OrderFieldLockApplyDO::getOrderId, id).last("limit 1")); | |
637 | - if (Objects.nonNull(applyDO)) { | |
638 | - throw new BusinessException("该账单还在审批中,请联系总经理审批后操作!"); | |
639 | - } | |
640 | - } | |
641 | - | |
642 | - @Override | |
643 | - public ServerResult commitApply(InvoiceBillCommitApplyVO commitApplyVO) { | |
644 | - InvoiceBillOrderDO invoiceBillOrderDO = getById(commitApplyVO.getId()); | |
645 | - if (Objects.isNull(invoiceBillOrderDO)) { | |
646 | - throw new BusinessException("账单不存在!"); | |
647 | - } | |
648 | - Long userId = dataScope.getLoginUserId(); | |
649 | - checkApply(commitApplyVO, userId); | |
650 | - | |
651 | - OrderFieldLockApplyDO applyDO = initOrderFieldLockApplyDO(invoiceBillOrderDO, userId); | |
652 | - transactionHelper.run(() -> { | |
653 | - orderFieldLockApplyService.save(applyDO); | |
654 | - invoiceBillOrderDO.setStatus(ApplyStatusEnum.WAIT_AUDIT.getStatus()); | |
655 | - invoiceBillOrderDO.setActualRefundDate(DateUtils.format(LocalDateTime.now(), DateUtils.DATE)); | |
656 | - updateById(invoiceBillOrderDO); | |
657 | - }); | |
658 | - return ServerResult.success(); | |
659 | - } | |
660 | - | |
661 | - /** | |
662 | - * @param commitApplyVO | |
663 | - * @param userId | |
664 | - */ | |
665 | - private void checkApply(InvoiceBillCommitApplyVO commitApplyVO, Long userId) { | |
666 | - List<OrderFieldLockApplyDO> applyDOS = orderFieldLockApplyService.list(new LambdaQueryWrapper<OrderFieldLockApplyDO>() | |
667 | - .eq(BaseDO::getEnableFlag, Constant.ENABLE_TEN) | |
668 | - .eq(OrderFieldLockApplyDO::getOrderId, commitApplyVO.getId()) | |
669 | - .eq(OrderFieldLockApplyDO::getApplyUserId, userId) | |
670 | - .eq(OrderFieldLockApplyDO::getType, ApplyTypeEnum.INVOICE_BILL_APPLY.getType()) | |
671 | - .eq(OrderFieldLockApplyDO::getStatus, ApplyStatusEnum.WAIT_AUDIT.getStatus())); | |
672 | - if (CollectionUtils.isNotEmpty(applyDOS)) { | |
673 | - throw new BusinessException(ServerResultCode.APPLY_UNLOCK_FIELD_EXIST); | |
674 | - } | |
675 | - } | |
676 | - | |
677 | - /** | |
678 | - * @param invoiceBillOrderDO | |
679 | - * @param userId | |
680 | - * @return | |
681 | - */ | |
682 | - private OrderFieldLockApplyDO initOrderFieldLockApplyDO(InvoiceBillOrderDO invoiceBillOrderDO, Long userId) { | |
683 | - OrderLockFieldVO lockFieldVO = new OrderLockFieldVO(); | |
684 | - lockFieldVO.setInvoiceBillOrderDO(invoiceBillOrderDO); | |
685 | - return OrderFieldLockApplyDO.builder() | |
686 | - .applyUserId(userId) | |
687 | - .auditUserId(null) | |
688 | - .fields(JSONObject.toJSONString(lockFieldVO)) | |
689 | - .orderId(invoiceBillOrderDO.getId()) | |
690 | - .type(ApplyTypeEnum.INVOICE_BILL_APPLY.getType()) | |
691 | - .remark(ApplyTypeEnum.INVOICE_BILL_APPLY.getDesc()) | |
692 | - .status(ApplyStatusEnum.WAIT_AUDIT.getStatus()) | |
693 | - .auditRoleCodes(RoleEnum.BUSINESS_USER.getCode() + Constant.COMMA_CHARACTER + RoleEnum.ADMIN.getCode()) | |
694 | - .build(); | |
695 | - } | |
696 | - | |
697 | - /** | |
698 | - * 通过主键删除数据 | |
699 | - * | |
700 | - * @param invoiceBillOrderQueryVO 筛选条件 | |
701 | - * @return 是否成功 | |
702 | - */ | |
703 | - @Override | |
704 | - public ServerResult deleteById(InvoiceBillOrderQueryVO invoiceBillOrderQueryVO) { | |
705 | - List<Long> ids = invoiceBillOrderQueryVO.getIds(); | |
706 | - if (CollUtil.isEmpty(ids)) { | |
707 | - return ServerResult.fail("ids 参数不能为空"); | |
708 | - } | |
709 | - List<InvoiceBillOrderDO> invoiceBillOrderList = listByIds(ids); | |
710 | - if (CollUtil.isEmpty(invoiceBillOrderList)) { | |
711 | - return ServerResult.success(); | |
712 | - } | |
713 | - transactionHelper.run(() -> { | |
714 | - removeByIds(ids); | |
715 | - invoiceBillMappingService.remove(new LambdaQueryWrapper<InvoiceBillMappingDO>().in(InvoiceBillMappingDO::getInvoiceBillId, ids)); | |
716 | - }); | |
717 | - | |
718 | - return ServerResult.success(); | |
719 | - } | |
720 | -} |
src/main/java/com/order/erp/service/order/impl/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 | -} |