Commit 1e436f605d7a66335dba2b5a94e05da6c6dbd9b3

Authored by 谢茂盛
2 parents bfb51ca5 b51d8686

Merge remote-tracking branch 'origin/dev_finance_20240830' into test

Showing 43 changed files with 2890 additions and 2 deletions
sql/dml_erp_bill_v2.sql 0 → 100644
  1 +DROP TABLE IF EXISTS `invoice_bill_order`;
  2 +CREATE TABLE `invoice_bill_order` (
  3 + `id` bigint NOT NULL AUTO_INCREMENT,
  4 + `invoice_no` varchar(64) NOT NULL COMMENT '发票单号',
  5 + `bg_url` varchar(512) default NULL COMMENT '报关单url地址',
  6 + `back_refund_date` varchar(64) default null COMMENT '必须回款日期',
  7 + `actual_refund_date` varchar(64) default null COMMENT '实际回款日期',
  8 + `deduct_amount` decimal(20,6) DEFAULT NULL COMMENT '发生扣款金额',
  9 + `deduct_url` varchar(512) default NULL COMMENT '扣款单url地址',
  10 + `actual_receivable_amount` decimal(20,6) DEFAULT NULL COMMENT '实际应收金额',
  11 + `actual_payed_amount1` decimal(20,6) DEFAULT NULL COMMENT '实际应付金额1',
  12 + `actual_payed_amount2` decimal(20,6) DEFAULT NULL COMMENT '实际应付金额2',
  13 + `actual_payed_amount3` decimal(20,6) DEFAULT NULL COMMENT '实际应付金额3',
  14 + `other_amount` decimal(20,6) DEFAULT NULL COMMENT '其他费用金额',
  15 + `status` INT NOT NULL COMMENT '总经理审核状态 0:待审核、1:审核通过,2:审核驳回',
  16 + `enable_flag` INT NOT NULL COMMENT '是否可用 10-可用 20-删除',
  17 + `create_time` DATETIME NOT NULL COMMENT '创建时间',
  18 + `create_by` varchar(64) NOT NULL COMMENT '创建人',
  19 + `modify_time` DATETIME DEFAULT NULL COMMENT '修改时间',
  20 + `modify_by` varchar(64) DEFAULT NULL COMMENT '修改人',
  21 + `version` INT DEFAULT NULL COMMENT '版本号--乐观锁预留字段',
  22 + PRIMARY KEY (`id`)
  23 +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='应收款账单表';
  24 +
  25 +DROP TABLE IF EXISTS `invoice_bill_mapping`;
  26 +CREATE TABLE `invoice_bill_mapping` (
  27 + `id` bigint NOT NULL AUTO_INCREMENT,
  28 + `invoice_no` varchar(64) NOT NULL COMMENT '发票单号',
  29 + `invoice_bill_id` bigint DEFAULT '0' COMMENT 'invoice账单id',
  30 + `order_id` bigint DEFAULT '0' COMMENT '订单id',
  31 + `enable_flag` INT NOT NULL COMMENT '是否可用 10-可用 20-删除',
  32 + `create_time` DATETIME NOT NULL COMMENT '创建时间',
  33 + `create_by` varchar(64) NOT NULL COMMENT '创建人',
  34 + `modify_time` DATETIME DEFAULT NULL COMMENT '修改时间',
  35 + `modify_by` varchar(64) DEFAULT NULL COMMENT '修改人',
  36 + `version` INT DEFAULT NULL COMMENT '版本号--乐观锁预留字段',
  37 + PRIMARY KEY (`id`)
  38 +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='应收款账单关联订单映射表';
  39 +
  40 +
  41 +DROP TABLE IF EXISTS `produce_payment_check_bill_order`;
  42 +CREATE TABLE `produce_payment_check_bill_order` (
  43 + `id` bigint NOT NULL AUTO_INCREMENT,
  44 + `check_no` varchar(64) NOT NULL COMMENT '生产科对账单',
  45 + `invoice_url` varchar(512) default NULL COMMENT '发票url地址',
  46 + `deduct_pdf_url` varchar(512) default NULL COMMENT '扣款单url地址',
  47 + `payed_date` varchar(64) default null COMMENT '生产科应付款日期',
  48 + `deduct_dept` varchar(64) default null COMMENT '生产科扣款责任部门',
  49 + `deduct_amount` decimal(20,6) DEFAULT NULL COMMENT '生产科扣款金额',
  50 + `actual_payed_amount` decimal(20,6) DEFAULT NULL COMMENT '实际应付金额',
  51 + `status` INT NOT NULL COMMENT '总经理审核状态 0:待审核、1:审核通过,2:审核驳回',
  52 + `enable_flag` INT NOT NULL COMMENT '是否可用 10-可用 20-删除',
  53 + `create_time` DATETIME NOT NULL COMMENT '创建时间',
  54 + `create_by` varchar(64) NOT NULL COMMENT '创建人',
  55 + `modify_time` DATETIME DEFAULT NULL COMMENT '修改时间',
  56 + `modify_by` varchar(64) DEFAULT NULL COMMENT '修改人',
  57 + `version` INT DEFAULT NULL COMMENT '版本号--乐观锁预留字段',
  58 + PRIMARY KEY (`id`)
  59 +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='生产科对账单应收账单';
  60 +
  61 +DROP TABLE IF EXISTS `check_bill_mapping`;
  62 +CREATE TABLE `check_bill_mapping` (
  63 + `id` bigint NOT NULL AUTO_INCREMENT,
  64 + `check_no` varchar(64) NOT NULL COMMENT '生产科对账单号',
  65 + `check_bill_id` bigint DEFAULT '0' COMMENT 'check账单id',
  66 + `order_id` bigint DEFAULT '0' COMMENT '订单id',
  67 + `enable_flag` INT NOT NULL COMMENT '是否可用 10-可用 20-删除',
  68 + `create_time` DATETIME NOT NULL COMMENT '创建时间',
  69 + `create_by` varchar(64) NOT NULL COMMENT '创建人',
  70 + `modify_time` DATETIME DEFAULT NULL COMMENT '修改时间',
  71 + `modify_by` varchar(64) DEFAULT NULL COMMENT '修改人',
  72 + `version` INT DEFAULT NULL COMMENT '版本号--乐观锁预留字段',
  73 + PRIMARY KEY (`id`)
  74 +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='生产科对账单应收账单映射表';
  75 +
... ...
src/main/java/com/order/erp/controller/InvoiceBillOrderController.java 0 → 100644
  1 +package com.order.erp.controller;
  2 +
  3 +import com.order.erp.common.annotation.AnonymousAccess;
  4 +import com.order.erp.common.constant.ServerResult;
  5 +import com.order.erp.common.excel4j.exceptions.Excel4JException;
  6 +import com.order.erp.common.jsr303.OperateGroup;
  7 +import com.order.erp.domain.vo.order.*;
  8 +import com.order.erp.service.order.InvoiceBillOrderService;
  9 +import io.swagger.annotations.ApiOperation;
  10 +import org.springframework.validation.annotation.Validated;
  11 +import org.springframework.web.bind.annotation.PostMapping;
  12 +import org.springframework.web.bind.annotation.RequestBody;
  13 +import org.springframework.web.bind.annotation.RequestMapping;
  14 +import org.springframework.web.bind.annotation.RestController;
  15 +
  16 +import javax.annotation.Resource;
  17 +import javax.servlet.http.HttpServletResponse;
  18 +import java.io.IOException;
  19 +
  20 +/**
  21 + * 应收款账单表(InvoiceBillOrder)表控制层
  22 + *
  23 + * @author makejava
  24 + * @since 2024-08-05 16:26:34
  25 + */
  26 +@RestController
  27 +@RequestMapping("/order/erp/invoice_bill")
  28 +public class InvoiceBillOrderController {
  29 + /**
  30 + * 服务对象
  31 + */
  32 + @Resource
  33 + private InvoiceBillOrderService invoiceBillOrderService;
  34 +
  35 + /**
  36 + * 分页查询
  37 + *
  38 + * @param invoiceBillOrderQueryVO 查询条件
  39 + * @return 查询结果
  40 + */
  41 + @PostMapping("/list_by_page")
  42 + public ServerResult listByPage(@RequestBody @Validated({OperateGroup.List.class}) InvoiceBillOrderQueryVO invoiceBillOrderQueryVO) {
  43 + return invoiceBillOrderService.listByPage(invoiceBillOrderQueryVO);
  44 + }
  45 +
  46 + /**
  47 + * 基础订单查询
  48 + *
  49 + * @param queryVO 查询条件
  50 + * @return 查询结果
  51 + */
  52 + @PostMapping("/list_base_order_info_by")
  53 + public ServerResult listBaseOrderInfoBy(@RequestBody @Validated InvoiceBaseOrderQueryVO queryVO) {
  54 + return invoiceBillOrderService.listBaseOrderInfoBy(queryVO);
  55 + }
  56 +
  57 + /**
  58 + * 分析列表
  59 + *
  60 + * @param queryVO 查询条件
  61 + * @return 查询结果
  62 + */
  63 + @PostMapping("/list_analysis_by")
  64 + public ServerResult listAnalysisBy(@RequestBody @Validated({OperateGroup.List.class}) InvoiceBillAnalysisVO queryVO) {
  65 + return invoiceBillOrderService.listAnalysisBy(queryVO);
  66 + }
  67 +
  68 + /**
  69 + * 导出分析列表
  70 + *
  71 + * @param queryVO 查询条件
  72 + * @return 查询结果
  73 + */
  74 + @PostMapping(value = "/export")
  75 + @ApiOperation("导出分析列表")
  76 + @AnonymousAccess
  77 + public void export(HttpServletResponse response, @RequestBody @Validated InvoiceBillAnalysisVO queryVO) throws IOException, Excel4JException {
  78 + invoiceBillOrderService.export(response, queryVO);
  79 + }
  80 +
  81 + /**
  82 + * 创建invoice单据
  83 + *
  84 + * @param createVO 数据VO
  85 + * @return 新增结果
  86 + */
  87 + @PostMapping("/create")
  88 + public ServerResult create(@RequestBody InvoiceBillCreateVO createVO) {
  89 + return invoiceBillOrderService.create(createVO);
  90 + }
  91 +
  92 + /**
  93 + * 获取必须回款日期
  94 + *
  95 + * @param createVO 数据VO
  96 + * @return 新增结果
  97 + */
  98 + @PostMapping("/get_back_refund_date")
  99 + public ServerResult getBackRefundDate(@RequestBody InvoiceBillCreateVO createVO) {
  100 + return invoiceBillOrderService.getBackRefundDate(createVO);
  101 + }
  102 +
  103 + /**
  104 + * 更新扣款信息
  105 + *
  106 + * @param deductInfoVO 数据VO
  107 + * @return 编辑结果
  108 + */
  109 + @PostMapping("/update_deduct_info")
  110 + public ServerResult updateDeductInfo(@RequestBody InvoiceBillDeductInfoVO deductInfoVO) {
  111 + return invoiceBillOrderService.updateDeductInfo(deductInfoVO);
  112 + }
  113 +
  114 + /**
  115 + * 更新其他金额信息
  116 + *
  117 + * @param amountInfoVO 数据VO
  118 + * @return 编辑结果
  119 + */
  120 + @PostMapping("/update_amount_info")
  121 + public ServerResult updateAmountInfo(@RequestBody InvoiceBillAmountInfoVO amountInfoVO) {
  122 + return invoiceBillOrderService.updateAmountInfo(amountInfoVO);
  123 + }
  124 +
  125 + /**
  126 + * 提交审核
  127 + *
  128 + * @param commitApplyVO 数据VO
  129 + * @return 编辑结果
  130 + */
  131 + @PostMapping("/commit_apply")
  132 + public ServerResult commitApply(@RequestBody InvoiceBillCommitApplyVO commitApplyVO) {
  133 + return invoiceBillOrderService.commitApply(commitApplyVO);
  134 + }
  135 +
  136 + /**
  137 + * 删除数据
  138 + *
  139 + * @param invoiceBillOrderQueryVO 查询条件
  140 + * @return 删除是否成功
  141 + */
  142 + @PostMapping("/delete_by_id")
  143 + public ServerResult deleteById(@RequestBody InvoiceBillOrderQueryVO invoiceBillOrderQueryVO) {
  144 + return invoiceBillOrderService.deleteById(invoiceBillOrderQueryVO);
  145 + }
  146 +
  147 +}
  148 +
... ...
src/main/java/com/order/erp/controller/LocalStorageController.java
... ... @@ -31,11 +31,18 @@ public class LocalStorageController {
31 31 return localStorageService.create(name, file);
32 32 }
33 33  
34   - @ApiOperation("上传文件到oss服务")
  34 + @ApiOperation("上传图片到oss服务")
35 35 @PostMapping(value = "/upload_oss")
36 36 @AnonymousAccess
37 37 public ServerResult upload2oss(@RequestParam String name, @RequestParam("file") MultipartFile file) {
38 38 return localStorageService.uploadByAliOss(name, file);
39 39 }
40 40  
  41 + @ApiOperation("上传文件到oss服务")
  42 + @PostMapping(value = "/upload_file_oss")
  43 + @AnonymousAccess
  44 + public ServerResult uploadFile2oss(@RequestParam String name, @RequestParam("file") MultipartFile file) {
  45 + return localStorageService.uploadFileByAliOss(name, file);
  46 + }
  47 +
41 48 }
42 49 \ No newline at end of file
... ...
src/main/java/com/order/erp/controller/ProducePaymentCheckBillOrderController.java 0 → 100644
  1 +package com.order.erp.controller;
  2 +
  3 +import com.order.erp.common.constant.ServerResult;
  4 +import com.order.erp.common.jsr303.OperateGroup;
  5 +import com.order.erp.domain.vo.order.ProducePaymentCheckBillOrderQueryVO;
  6 +import com.order.erp.domain.vo.order.ProducePaymentCheckBillOrderVO;
  7 +import com.order.erp.service.order.ProducePaymentCheckBillOrderService;
  8 +import org.springframework.validation.annotation.Validated;
  9 +import org.springframework.web.bind.annotation.PostMapping;
  10 +import org.springframework.web.bind.annotation.RequestBody;
  11 +import org.springframework.web.bind.annotation.RequestMapping;
  12 +import org.springframework.web.bind.annotation.RestController;
  13 +
  14 +import javax.annotation.Resource;
  15 +
  16 +/**
  17 + * 生产科对账单应收账单(ProducePaymentCheckBillOrder)表控制层
  18 + *
  19 + * @author makejava
  20 + * @since 2024-08-05 16:26:35
  21 + */
  22 +@RestController
  23 +@RequestMapping("/order/erp/check_bill/")
  24 +public class ProducePaymentCheckBillOrderController {
  25 + /**
  26 + * 服务对象
  27 + */
  28 + @Resource
  29 + private ProducePaymentCheckBillOrderService producePaymentCheckBillOrderService;
  30 +
  31 + /**
  32 + * 分页查询
  33 + *
  34 + * @param producePaymentCheckBillOrderQueryVO 查询条件
  35 + * @return 查询结果
  36 + */
  37 + @PostMapping("/list")
  38 + public ServerResult list(@RequestBody @Validated({OperateGroup.List.class}) ProducePaymentCheckBillOrderQueryVO producePaymentCheckBillOrderQueryVO) {
  39 + return producePaymentCheckBillOrderService.list(producePaymentCheckBillOrderQueryVO);
  40 + }
  41 +
  42 + /**
  43 + * 通过主键查询单条数据
  44 + *
  45 + * @param producePaymentCheckBillOrderQueryVO 查询条件
  46 + * @return 单条数据
  47 + */
  48 + @PostMapping("/query_by_id")
  49 + public ServerResult queryById(@RequestBody ProducePaymentCheckBillOrderQueryVO producePaymentCheckBillOrderQueryVO) {
  50 + return producePaymentCheckBillOrderService.queryById(producePaymentCheckBillOrderQueryVO);
  51 + }
  52 +
  53 + /**
  54 + * 新增数据
  55 + *
  56 + * @param producePaymentCheckBillOrderVO 数据VO
  57 + * @return 新增结果
  58 + */
  59 + @PostMapping("/add")
  60 + public ServerResult add(@RequestBody ProducePaymentCheckBillOrderVO producePaymentCheckBillOrderVO) {
  61 + return producePaymentCheckBillOrderService.add(producePaymentCheckBillOrderVO);
  62 + }
  63 +
  64 + /**
  65 + * 编辑数据
  66 + *
  67 + * @param producePaymentCheckBillOrderVO 数据VO
  68 + * @return 编辑结果
  69 + */
  70 + @PostMapping("/edit")
  71 + public ServerResult edit(@RequestBody ProducePaymentCheckBillOrderVO producePaymentCheckBillOrderVO) {
  72 + return producePaymentCheckBillOrderService.edit(producePaymentCheckBillOrderVO);
  73 + }
  74 +
  75 + /**
  76 + * 删除数据
  77 + *
  78 + * @param producePaymentCheckBillOrderQueryVO 查询条件
  79 + * @return 删除是否成功
  80 + */
  81 + @PostMapping("/delete_by_id")
  82 + public ServerResult deleteById(@RequestBody ProducePaymentCheckBillOrderQueryVO producePaymentCheckBillOrderQueryVO) {
  83 + return producePaymentCheckBillOrderService.deleteById(producePaymentCheckBillOrderQueryVO);
  84 + }
  85 +
  86 +}
  87 +
... ...
src/main/java/com/order/erp/domain/ApplyStatusEnum.java
... ... @@ -13,6 +13,8 @@ import lombok.Getter;
13 13 @AllArgsConstructor
14 14 public enum ApplyStatusEnum {
15 15  
  16 + NO_COMMIT(-1, "未提交审核"),
  17 +
16 18 WAIT_AUDIT(0, "待审批"),
17 19  
18 20 AUDIT_PASS(10, "已通过"),
... ...
src/main/java/com/order/erp/domain/ApplyTypeEnum.java
... ... @@ -18,6 +18,10 @@ public enum ApplyTypeEnum {
18 18 ORDER_PROFIT_APPLY(10, "利润分析申请"),
19 19  
20 20 ORDER_REPORT_APPLY(20, "项目报告书申请"),
  21 +
  22 + INVOICE_BILL_APPLY(30, "应收账单申请"),
  23 +
  24 + CHECK_BILL_APPLY(40, "应付账单申请"),
21 25 ;
22 26 private Integer type;
23 27  
... ...
src/main/java/com/order/erp/domain/dto/order/CheckBillMappingDO.java 0 → 100644
  1 +package com.order.erp.domain.dto.order;
  2 +
  3 +import com.baomidou.mybatisplus.annotation.TableName;
  4 +import com.order.erp.domain.dto.BaseDO;
  5 +import lombok.*;
  6 +import lombok.experimental.SuperBuilder;
  7 +
  8 +import java.io.Serializable;
  9 +
  10 +/**
  11 + * 生产科对账单应收账单映射表(CheckBillMapping)实体类
  12 + *
  13 + * @author makejava
  14 + * @since 2024-08-05 16:26:36
  15 + */
  16 +@TableName("check_bill_mapping")
  17 +@Data
  18 +@AllArgsConstructor
  19 +@ToString
  20 +@NoArgsConstructor
  21 +@EqualsAndHashCode(callSuper = false)
  22 +@SuperBuilder
  23 +public class CheckBillMappingDO extends BaseDO implements Serializable {
  24 + private static final long serialVersionUID = 199786248752278040L;
  25 +
  26 + private Long id;
  27 + /**
  28 + * 生产科对账单号
  29 + */
  30 + private String checkNo;
  31 + /**
  32 + * check账单id
  33 + */
  34 + private Long checkBillId;
  35 + /**
  36 + * 订单id
  37 + */
  38 + private Long orderId;
  39 +
  40 +}
... ...
src/main/java/com/order/erp/domain/dto/order/InvoiceBillMappingDO.java 0 → 100644
  1 +package com.order.erp.domain.dto.order;
  2 +
  3 +import com.baomidou.mybatisplus.annotation.TableName;
  4 +import com.order.erp.domain.dto.BaseDO;
  5 +import lombok.*;
  6 +import lombok.experimental.SuperBuilder;
  7 +
  8 +import java.io.Serializable;
  9 +
  10 +/**
  11 + * 应收款账单关联订单映射表(InvoiceBillMapping)实体类
  12 + *
  13 + * @author makejava
  14 + * @since 2024-08-05 16:26:36
  15 + */
  16 +@TableName("invoice_bill_mapping")
  17 +@Data
  18 +@AllArgsConstructor
  19 +@ToString
  20 +@NoArgsConstructor
  21 +@EqualsAndHashCode(callSuper = false)
  22 +@SuperBuilder
  23 +public class InvoiceBillMappingDO extends BaseDO implements Serializable {
  24 +
  25 + private Long id;
  26 + /**
  27 + * 发票单号
  28 + */
  29 + private String invoiceNo;
  30 + /**
  31 + * invoice账单id
  32 + */
  33 + private Long invoiceBillId;
  34 + /**
  35 + * 订单id
  36 + */
  37 + private Long orderId;
  38 +
  39 +}
... ...
src/main/java/com/order/erp/domain/dto/order/InvoiceBillOrderDO.java 0 → 100644
  1 +package com.order.erp.domain.dto.order;
  2 +
  3 +import com.baomidou.mybatisplus.annotation.TableName;
  4 +import com.order.erp.domain.dto.BaseDO;
  5 +import lombok.*;
  6 +import lombok.experimental.SuperBuilder;
  7 +
  8 +import java.io.Serializable;
  9 +import java.math.BigDecimal;
  10 +
  11 +/**
  12 + * 应收款账单表(InvoiceBillOrder)实体类
  13 + *
  14 + * @author makejava
  15 + * @since 2024-08-05 16:26:33
  16 + */
  17 +@TableName("invoice_bill_order")
  18 +@Data
  19 +@AllArgsConstructor
  20 +@ToString
  21 +@NoArgsConstructor
  22 +@EqualsAndHashCode(callSuper = false)
  23 +@SuperBuilder
  24 +public class InvoiceBillOrderDO extends BaseDO implements Serializable {
  25 +
  26 + private Long id;
  27 + /**
  28 + * 发票单号
  29 + */
  30 + private String invoiceNo;
  31 + /**
  32 + * 报关单url地址
  33 + */
  34 + private String bgUrl;
  35 + /**
  36 + * 必须回款日期
  37 + */
  38 + private String backRefundDate;
  39 + /**
  40 + * 实际回款日期
  41 + */
  42 + private String actualRefundDate;
  43 +
  44 + /**
  45 + * 发生扣款金额
  46 + */
  47 + private BigDecimal deductAmount;
  48 + /**
  49 + * 扣款单url地址
  50 + */
  51 + private String deductUrl;
  52 + /**
  53 + * 实际应收金额
  54 + */
  55 + private BigDecimal actualReceivableAmount;
  56 + /**
  57 + * 实际应付金额1
  58 + */
  59 + private BigDecimal actualPayedAmount1;
  60 + /**
  61 + * 实际应付金额2
  62 + */
  63 + private BigDecimal actualPayedAmount2;
  64 + /**
  65 + * 实际应付金额3
  66 + */
  67 + private BigDecimal actualPayedAmount3;
  68 + /**
  69 + * 其他费用金额
  70 + */
  71 + private BigDecimal otherAmount;
  72 + /**
  73 + * 总经理审核状态 0:待审核、1:审核通过,2:审核驳回
  74 + */
  75 + private Integer status;
  76 +
  77 +}
... ...
src/main/java/com/order/erp/domain/dto/order/ProducePaymentCheckBillOrderDO.java 0 → 100644
  1 +package com.order.erp.domain.dto.order;
  2 +
  3 +import com.baomidou.mybatisplus.annotation.TableName;
  4 +import com.order.erp.domain.dto.BaseDO;
  5 +import lombok.*;
  6 +import lombok.experimental.SuperBuilder;
  7 +
  8 +import java.io.Serializable;
  9 +
  10 +/**
  11 + * 生产科对账单应收账单(ProducePaymentCheckBillOrder)实体类
  12 + *
  13 + * @author makejava
  14 + * @since 2024-08-05 16:26:35
  15 + */
  16 +@TableName("produce_payment_check_bill_order")
  17 +@Data
  18 +@AllArgsConstructor
  19 +@ToString
  20 +@NoArgsConstructor
  21 +@EqualsAndHashCode(callSuper = false)
  22 +@SuperBuilder
  23 +public class ProducePaymentCheckBillOrderDO extends BaseDO implements Serializable {
  24 +
  25 + private Long id;
  26 + /**
  27 + * 生产科对账单
  28 + */
  29 + private String checkNo;
  30 + /**
  31 + * 发票url地址
  32 + */
  33 + private String invoiceUrl;
  34 + /**
  35 + * 扣款单url地址
  36 + */
  37 + private String deductPdfUrl;
  38 + /**
  39 + * 生产科应付款日期
  40 + */
  41 + private String payedDate;
  42 + /**
  43 + * 生产科扣款责任部门
  44 + */
  45 + private String deductDept;
  46 + /**
  47 + * 生产科扣款金额
  48 + */
  49 + private Double deductAmount;
  50 + /**
  51 + * 实际应付金额
  52 + */
  53 + private Double actualPayedAmount;
  54 + /**
  55 + * 总经理审核状态 0:待审核、1:审核通过,2:审核驳回
  56 + */
  57 + private Integer status;
  58 +
  59 +}
... ...
src/main/java/com/order/erp/domain/vo/order/CheckBillMappingQueryVO.java 0 → 100644
  1 +package com.order.erp.domain.vo.order;
  2 +
  3 +import com.order.erp.domain.vo.BasePageVO;
  4 +import lombok.*;
  5 +import lombok.experimental.SuperBuilder;
  6 +
  7 +import java.io.Serializable;
  8 +import java.util.List;
  9 +
  10 +/**
  11 + * 生产科对账单应收账单映射表(CheckBillMapping)实体类
  12 + *
  13 + * @author makejava
  14 + * @since 2024-08-05 16:26:37
  15 + */
  16 +@Data
  17 +@AllArgsConstructor
  18 +@ToString
  19 +@NoArgsConstructor
  20 +@EqualsAndHashCode(callSuper = false)
  21 +@SuperBuilder
  22 +public class CheckBillMappingQueryVO extends BasePageVO implements Serializable {
  23 +
  24 + private List<Long> ids;
  25 +
  26 +
  27 + private Long id;
  28 + /**
  29 + * 生产科对账单号
  30 + */
  31 + private String checkNo;
  32 + /**
  33 + * check账单id
  34 + */
  35 + private Long checkBillId;
  36 + /**
  37 + * 订单id
  38 + */
  39 + private Long orderId;
  40 +
  41 +
  42 +}
  43 +
... ...
src/main/java/com/order/erp/domain/vo/order/CheckBillMappingVO.java 0 → 100644
  1 +package com.order.erp.domain.vo.order;
  2 +
  3 +import lombok.*;
  4 +import lombok.experimental.SuperBuilder;
  5 +
  6 +import java.io.Serializable;
  7 +
  8 +/**
  9 + * 生产科对账单应收账单映射表(CheckBillMapping)实体类
  10 + *
  11 + * @author makejava
  12 + * @since 2024-08-05 16:26:37
  13 + */
  14 +@Data
  15 +@AllArgsConstructor
  16 +@ToString
  17 +@NoArgsConstructor
  18 +@EqualsAndHashCode(callSuper = false)
  19 +@SuperBuilder
  20 +public class CheckBillMappingVO implements Serializable {
  21 +
  22 + private Long id;
  23 + /**
  24 + * 生产科对账单号
  25 + */
  26 + private String checkNo;
  27 + /**
  28 + * check账单id
  29 + */
  30 + private Long checkBillId;
  31 + /**
  32 + * 订单id
  33 + */
  34 + private Long orderId;
  35 +
  36 +
  37 +}
... ...
src/main/java/com/order/erp/domain/vo/order/InvoiceBaseOrderQueryVO.java 0 → 100644
  1 +package com.order.erp.domain.vo.order;
  2 +
  3 +import com.order.erp.domain.vo.BasePageVO;
  4 +import lombok.*;
  5 +import lombok.experimental.SuperBuilder;
  6 +
  7 +import javax.validation.constraints.NotBlank;
  8 +import java.io.Serializable;
  9 +
  10 +/**
  11 + * 应收款账单表(InvoiceBillOrder)实体类
  12 + *
  13 + * @author makejava
  14 + * @since 2024-08-05 16:26:34
  15 + */
  16 +@Data
  17 +@AllArgsConstructor
  18 +@ToString
  19 +@NoArgsConstructor
  20 +@EqualsAndHashCode(callSuper = false)
  21 +@SuperBuilder
  22 +public class InvoiceBaseOrderQueryVO extends BasePageVO implements Serializable {
  23 +
  24 + /**
  25 + * 发票单号
  26 + */
  27 + @NotBlank(message = "发票单号不能为空")
  28 + private String invoiceNo;
  29 +}
  30 +
... ...
src/main/java/com/order/erp/domain/vo/order/InvoiceBillAmountInfoVO.java 0 → 100644
  1 +package com.order.erp.domain.vo.order;
  2 +
  3 +import lombok.*;
  4 +import lombok.experimental.SuperBuilder;
  5 +
  6 +import java.io.Serializable;
  7 +import java.math.BigDecimal;
  8 +
  9 +/**
  10 + * 应收款账单 -- 其他金额信息
  11 + *
  12 + * @author makejava
  13 + * @since 2024-08-05 16:26:33
  14 + */
  15 +@Data
  16 +@AllArgsConstructor
  17 +@ToString
  18 +@NoArgsConstructor
  19 +@EqualsAndHashCode(callSuper = false)
  20 +@SuperBuilder
  21 +public class InvoiceBillAmountInfoVO implements Serializable {
  22 +
  23 + private Long id;
  24 +
  25 + /**
  26 + * 报关单url地址
  27 + */
  28 + private String bgUrl;
  29 +
  30 + /**
  31 + * 实际应收金额
  32 + */
  33 + private BigDecimal actualReceivableAmount;
  34 + /**
  35 + * 实际应付金额1
  36 + */
  37 + private BigDecimal actualPayedAmount1;
  38 + /**
  39 + * 实际应付金额2
  40 + */
  41 + private BigDecimal actualPayedAmount2;
  42 + /**
  43 + * 实际应付金额3
  44 + */
  45 + private BigDecimal actualPayedAmount3;
  46 + /**
  47 + * 其他费用金额
  48 + */
  49 + private BigDecimal otherAmount;
  50 +
  51 +}
... ...
src/main/java/com/order/erp/domain/vo/order/InvoiceBillAnalysisExportVO.java 0 → 100644
  1 +package com.order.erp.domain.vo.order;
  2 +
  3 +import lombok.*;
  4 +import lombok.experimental.SuperBuilder;
  5 +
  6 +import java.io.Serializable;
  7 +import java.math.BigDecimal;
  8 +
  9 +/**
  10 + * 应收款账单表(InvoiceBillOrder)实体类
  11 + *
  12 + * @author makejava
  13 + * @since 2024-08-05 16:26:33
  14 + */
  15 +@Data
  16 +@AllArgsConstructor
  17 +@ToString
  18 +@NoArgsConstructor
  19 +@EqualsAndHashCode(callSuper = false)
  20 +@SuperBuilder
  21 +public class InvoiceBillAnalysisExportVO implements Serializable {
  22 +
  23 + private Long id;
  24 +
  25 + /**
  26 + * 客户编码
  27 + */
  28 + private String customerCode;
  29 +
  30 + /**
  31 + * 发票单号
  32 + */
  33 + private String invoiceNo;
  34 +
  35 + /**
  36 + * 客户总价$
  37 + */
  38 + private BigDecimal customerTotalPrice;
  39 +
  40 + /**
  41 + * 发生扣款金额
  42 + */
  43 + private BigDecimal deductAmount;
  44 +
  45 + /**
  46 + * 实际应收金额
  47 + */
  48 + private BigDecimal actualReceivableAmount;
  49 +
  50 + /**
  51 + * 实际应付金额
  52 + */
  53 + private BigDecimal actualPayedAmount;
  54 +
  55 + /**
  56 + * 实际应收 - 实际应付
  57 + * 其他费用金额汇总
  58 + */
  59 + private BigDecimal otherAmount;
  60 +
  61 + /**
  62 + * 实际应收 - 实际应付 - 其他费用金额汇总
  63 + * 其他费用金额合计
  64 + */
  65 + private BigDecimal otherTotalAmount;
  66 +
  67 + /**
  68 + * 必须回款日期
  69 + */
  70 + private String backRefundDate;
  71 +
  72 + /**
  73 + * 实际回款日期
  74 + */
  75 + private String actualRefundDate;
  76 +
  77 +}
... ...
src/main/java/com/order/erp/domain/vo/order/InvoiceBillAnalysisResultVO.java 0 → 100644
  1 +package com.order.erp.domain.vo.order;
  2 +
  3 +import lombok.*;
  4 +import lombok.experimental.SuperBuilder;
  5 +
  6 +import java.io.Serializable;
  7 +import java.math.BigDecimal;
  8 +import java.util.List;
  9 +
  10 +/**
  11 + * 应收款账单表(InvoiceBillOrder)实体类
  12 + *
  13 + * @author makejava
  14 + * @since 2024-08-05 16:26:33
  15 + */
  16 +@Data
  17 +@AllArgsConstructor
  18 +@ToString
  19 +@NoArgsConstructor
  20 +@EqualsAndHashCode(callSuper = false)
  21 +@SuperBuilder
  22 +public class InvoiceBillAnalysisResultVO implements Serializable {
  23 +
  24 +
  25 + /**
  26 + * 导出列表
  27 + */
  28 + private List<InvoiceBillAnalysisExportVO> exportVOS;
  29 +
  30 + /**
  31 + * 合计数据
  32 + */
  33 +
  34 + /**
  35 + * 客户总价$
  36 + */
  37 + private BigDecimal customerTotalPrice;
  38 +
  39 + /**
  40 + * 发生扣款金额
  41 + */
  42 + private BigDecimal deductAmount;
  43 +
  44 + /**
  45 + * 实际应收金额
  46 + */
  47 + private BigDecimal actualReceivableAmount;
  48 +
  49 + /**
  50 + * 实际应付金额
  51 + */
  52 + private BigDecimal actualPayedAmount;
  53 +
  54 + /**
  55 + * 实际应收 - 实际应付
  56 + * 其他费用金额汇总
  57 + */
  58 + private BigDecimal otherAmount;
  59 +
  60 + /**
  61 + * 实际应收 - 实际应付 - 其他费用金额汇总
  62 + * 其他费用金额合计
  63 + */
  64 + private BigDecimal otherTotalAmount;
  65 +
  66 + /**
  67 + * 合计数据
  68 + */
  69 +
  70 +}
... ...
src/main/java/com/order/erp/domain/vo/order/InvoiceBillAnalysisVO.java 0 → 100644
  1 +package com.order.erp.domain.vo.order;
  2 +
  3 +import lombok.*;
  4 +import lombok.experimental.SuperBuilder;
  5 +
  6 +import java.io.Serializable;
  7 +
  8 +/**
  9 + * 应收款账单 -- 分析
  10 + *
  11 + * @author makejava
  12 + * @since 2024-08-05 16:26:33
  13 + */
  14 +@Data
  15 +@AllArgsConstructor
  16 +@ToString
  17 +@EqualsAndHashCode(callSuper = false)
  18 +@SuperBuilder
  19 +public class InvoiceBillAnalysisVO extends InvoiceBillOrderQueryVO implements Serializable {
  20 +
  21 +}
... ...
src/main/java/com/order/erp/domain/vo/order/InvoiceBillCommitApplyVO.java 0 → 100644
  1 +package com.order.erp.domain.vo.order;
  2 +
  3 +import lombok.*;
  4 +import lombok.experimental.SuperBuilder;
  5 +
  6 +import java.io.Serializable;
  7 +
  8 +/**
  9 + * 应收款账单 -- 提交审核
  10 + *
  11 + * @author makejava
  12 + * @since 2024-08-05 16:26:33
  13 + */
  14 +@Data
  15 +@AllArgsConstructor
  16 +@ToString
  17 +@NoArgsConstructor
  18 +@EqualsAndHashCode(callSuper = false)
  19 +@SuperBuilder
  20 +public class InvoiceBillCommitApplyVO implements Serializable {
  21 +
  22 + private Long id;
  23 +
  24 +}
... ...
src/main/java/com/order/erp/domain/vo/order/InvoiceBillCreateVO.java 0 → 100644
  1 +package com.order.erp.domain.vo.order;
  2 +
  3 +import lombok.*;
  4 +import lombok.experimental.SuperBuilder;
  5 +
  6 +import java.io.Serializable;
  7 +import java.util.List;
  8 +
  9 +/**
  10 + * 应收款账单表(InvoiceBillOrder)实体类
  11 + *
  12 + * @author makejava
  13 + * @since 2024-08-05 16:26:33
  14 + */
  15 +@Data
  16 +@AllArgsConstructor
  17 +@ToString
  18 +@NoArgsConstructor
  19 +@EqualsAndHashCode(callSuper = false)
  20 +@SuperBuilder
  21 +public class InvoiceBillCreateVO implements Serializable {
  22 + private static final long serialVersionUID = 543899167451834300L;
  23 +
  24 + private Long id;
  25 +
  26 + /**
  27 + * 发票单号
  28 + */
  29 + private String invoiceNo;
  30 +
  31 + /**
  32 + * 报关单url地址
  33 + */
  34 + private String bgUrl;
  35 +
  36 + /**
  37 + * 必须回款日期
  38 + */
  39 + private String backRefundDate;
  40 +
  41 + /**
  42 + * 订单id集合
  43 + */
  44 + private List<Long> orderIds;
  45 +
  46 +
  47 +}
... ...
src/main/java/com/order/erp/domain/vo/order/InvoiceBillDeductInfoVO.java 0 → 100644
  1 +package com.order.erp.domain.vo.order;
  2 +
  3 +import lombok.*;
  4 +import lombok.experimental.SuperBuilder;
  5 +
  6 +import java.io.Serializable;
  7 +import java.math.BigDecimal;
  8 +
  9 +/**
  10 + * 应收款账单 -- 扣款信息
  11 + *
  12 + * @author makejava
  13 + * @since 2024-08-05 16:26:33
  14 + */
  15 +@Data
  16 +@AllArgsConstructor
  17 +@ToString
  18 +@NoArgsConstructor
  19 +@EqualsAndHashCode(callSuper = false)
  20 +@SuperBuilder
  21 +public class InvoiceBillDeductInfoVO implements Serializable {
  22 +
  23 + private Long id;
  24 +
  25 + /**
  26 + * 发票单号
  27 + */
  28 + private String invoiceNo;
  29 +
  30 + /**
  31 + * 发生扣款金额
  32 + */
  33 + private BigDecimal deductAmount;
  34 +
  35 + /**
  36 + * 扣款单url地址
  37 + */
  38 + private String deductUrl;
  39 +
  40 +}
... ...
src/main/java/com/order/erp/domain/vo/order/InvoiceBillMappingQueryVO.java 0 → 100644
  1 +package com.order.erp.domain.vo.order;
  2 +
  3 +import com.order.erp.domain.vo.BasePageVO;
  4 +import lombok.*;
  5 +import lombok.experimental.SuperBuilder;
  6 +
  7 +import java.io.Serializable;
  8 +import java.util.List;
  9 +
  10 +/**
  11 + * 应收款账单关联订单映射表(InvoiceBillMapping)实体类
  12 + *
  13 + * @author makejava
  14 + * @since 2024-08-05 16:26:36
  15 + */
  16 +@Data
  17 +@AllArgsConstructor
  18 +@ToString
  19 +@NoArgsConstructor
  20 +@EqualsAndHashCode(callSuper = false)
  21 +@SuperBuilder
  22 +public class InvoiceBillMappingQueryVO extends BasePageVO implements Serializable {
  23 + private static final long serialVersionUID = -10772282327497511L;
  24 +
  25 + private List<Long> ids;
  26 +
  27 +
  28 + private Long id;
  29 + /**
  30 + * 发票单号
  31 + */
  32 + private String invoiceNo;
  33 + /**
  34 + * invoice账单id
  35 + */
  36 + private Long invoiceBillId;
  37 + /**
  38 + * 订单id
  39 + */
  40 + private Long orderId;
  41 +
  42 +
  43 +}
  44 +
... ...
src/main/java/com/order/erp/domain/vo/order/InvoiceBillMappingVO.java 0 → 100644
  1 +package com.order.erp.domain.vo.order;
  2 +
  3 +import lombok.*;
  4 +import lombok.experimental.SuperBuilder;
  5 +
  6 +import java.io.Serializable;
  7 +
  8 +/**
  9 + * 应收款账单关联订单映射表(InvoiceBillMapping)实体类
  10 + *
  11 + * @author makejava
  12 + * @since 2024-08-05 16:26:36
  13 + */
  14 +@Data
  15 +@AllArgsConstructor
  16 +@ToString
  17 +@NoArgsConstructor
  18 +@EqualsAndHashCode(callSuper = false)
  19 +@SuperBuilder
  20 +public class InvoiceBillMappingVO implements Serializable {
  21 + private static final long serialVersionUID = -55765026730369748L;
  22 +
  23 + private Long id;
  24 + /**
  25 + * 发票单号
  26 + */
  27 + private String invoiceNo;
  28 + /**
  29 + * invoice账单id
  30 + */
  31 + private Long invoiceBillId;
  32 + /**
  33 + * 订单id
  34 + */
  35 + private Long orderId;
  36 +
  37 +
  38 +}
... ...
src/main/java/com/order/erp/domain/vo/order/InvoiceBillOrderQueryVO.java 0 → 100644
  1 +package com.order.erp.domain.vo.order;
  2 +
  3 +import com.order.erp.domain.vo.BasePageVO;
  4 +import lombok.*;
  5 +import lombok.experimental.SuperBuilder;
  6 +
  7 +import java.io.Serializable;
  8 +import java.util.List;
  9 +
  10 +/**
  11 + * 应收款账单表(InvoiceBillOrder)实体类
  12 + *
  13 + * @author makejava
  14 + * @since 2024-08-05 16:26:34
  15 + */
  16 +@Data
  17 +@AllArgsConstructor
  18 +@ToString
  19 +@NoArgsConstructor
  20 +@EqualsAndHashCode(callSuper = false)
  21 +@SuperBuilder
  22 +public class InvoiceBillOrderQueryVO extends BasePageVO implements Serializable {
  23 +
  24 + private List<Long> ids;
  25 +
  26 + /**
  27 + * 发票单号
  28 + */
  29 + private String invoiceNo;
  30 +
  31 + /**
  32 + * 总经理审核状态 -1,未提交审核,0:待审核、1:审核通过,2:审核驳回
  33 + */
  34 + private Integer status;
  35 +
  36 + /**
  37 + * 客户编码
  38 + */
  39 + private String customerCode;
  40 +
  41 + /**
  42 + * 项目号
  43 + */
  44 + private String projectNo;
  45 +
  46 + /**
  47 + * 生产科
  48 + */
  49 + private String productionDepartment;
  50 +
  51 + /**
  52 + * 内部编号
  53 + */
  54 + private String innerNo;
  55 +
  56 + /**
  57 + * 客户po号
  58 + */
  59 + private String customerPo;
  60 +
  61 + /**
  62 + * 开始时间
  63 + */
  64 + private String startTime;
  65 +
  66 + /**
  67 + * 结束时间
  68 + */
  69 + private String endTime;
  70 +}
  71 +
... ...
src/main/java/com/order/erp/domain/vo/order/InvoiceBillOrderVO.java 0 → 100644
  1 +package com.order.erp.domain.vo.order;
  2 +
  3 +import lombok.*;
  4 +import lombok.experimental.SuperBuilder;
  5 +
  6 +import java.io.Serializable;
  7 +import java.math.BigDecimal;
  8 +
  9 +/**
  10 + * 应收款账单表(InvoiceBillOrder)实体类
  11 + *
  12 + * @author makejava
  13 + * @since 2024-08-05 16:26:33
  14 + */
  15 +@Data
  16 +@AllArgsConstructor
  17 +@ToString
  18 +@NoArgsConstructor
  19 +@EqualsAndHashCode(callSuper = false)
  20 +@SuperBuilder
  21 +public class InvoiceBillOrderVO implements Serializable {
  22 + private static final long serialVersionUID = 543899167451834300L;
  23 +
  24 + private Long id;
  25 +
  26 + /**
  27 + * 发票单号
  28 + */
  29 + private String invoiceNo;
  30 +
  31 + /**
  32 + * 报关单url地址
  33 + */
  34 + private String bgUrl;
  35 +
  36 + /**
  37 + * 必须回款日期
  38 + */
  39 + private String backRefundDate;
  40 +
  41 + /**
  42 + * 发生扣款金额
  43 + */
  44 + private BigDecimal deductAmount;
  45 +
  46 + /**
  47 + * 扣款单url地址
  48 + */
  49 + private String deductUrl;
  50 +
  51 + /**
  52 + * 实际应收金额
  53 + */
  54 + private BigDecimal actualReceivableAmount;
  55 +
  56 + /**
  57 + * 实际应付金额1
  58 + */
  59 + private BigDecimal actualPayedAmount1;
  60 +
  61 + /**
  62 + * 实际应付金额2
  63 + */
  64 + private BigDecimal actualPayedAmount2;
  65 +
  66 + /**
  67 + * 实际应付金额3
  68 + */
  69 + private BigDecimal actualPayedAmount3;
  70 +
  71 + /**
  72 + * 其他费用金额
  73 + */
  74 + private BigDecimal otherAmount;
  75 +
  76 + /**
  77 + * 总经理审核状态 0:待审核、1:审核通过,2:审核驳回
  78 + */
  79 + private Integer status;
  80 +
  81 +
  82 +}
... ...
src/main/java/com/order/erp/domain/vo/order/InvoiceHoldTimeItemVO.java 0 → 100644
  1 +package com.order.erp.domain.vo.order;
  2 +
  3 +import com.order.erp.domain.dto.order.OrderBaseInfoDO;
  4 +import lombok.*;
  5 +import lombok.experimental.SuperBuilder;
  6 +
  7 +import java.io.Serializable;
  8 +
  9 +/**
  10 + * 应收款账单 -- holdTime
  11 + *
  12 + * @author makejava
  13 + * @since 2024-08-05 16:26:33
  14 + */
  15 +@Data
  16 +@AllArgsConstructor
  17 +@ToString
  18 +@NoArgsConstructor
  19 +@EqualsAndHashCode(callSuper = false)
  20 +@SuperBuilder
  21 +public class InvoiceHoldTimeItemVO implements Serializable {
  22 +
  23 + /**
  24 + * 客户编码
  25 + */
  26 + private String customerCode;
  27 +
  28 + /**
  29 + * 订单hold时间
  30 + */
  31 + private String holdTime;
  32 +
  33 + /**
  34 + * 基础订单信息
  35 + */
  36 + private OrderBaseInfoDO baseInfoDO;
  37 +}
... ...
src/main/java/com/order/erp/domain/vo/order/InvoiceOrderBaseItemVO.java 0 → 100644
  1 +package com.order.erp.domain.vo.order;
  2 +
  3 +import lombok.*;
  4 +import lombok.experimental.SuperBuilder;
  5 +
  6 +import java.io.Serializable;
  7 +import java.math.BigDecimal;
  8 +
  9 +/**
  10 + * 应收款账单表(InvoiceBillOrder)实体类
  11 + *
  12 + * @author makejava
  13 + * @since 2024-08-05 16:26:33
  14 + */
  15 +@Data
  16 +@AllArgsConstructor
  17 +@ToString
  18 +@NoArgsConstructor
  19 +@EqualsAndHashCode(callSuper = false)
  20 +@SuperBuilder
  21 +public class InvoiceOrderBaseItemVO implements Serializable {
  22 +
  23 + private Long orderId;
  24 +
  25 + /**
  26 + * invoice编码
  27 + */
  28 + private String invoiceCode;
  29 +
  30 + /**
  31 + * 客户编码
  32 + */
  33 + private String customerCode;
  34 +
  35 + /**
  36 + * 客户总价$
  37 + */
  38 + private BigDecimal customerTotalPrice;
  39 +
  40 +
  41 +}
... ...
src/main/java/com/order/erp/domain/vo/order/ProducePaymentCheckBillOrderQueryVO.java 0 → 100644
  1 +package com.order.erp.domain.vo.order;
  2 +
  3 +import com.order.erp.domain.vo.BasePageVO;
  4 +import lombok.*;
  5 +import lombok.experimental.SuperBuilder;
  6 +
  7 +import java.io.Serializable;
  8 +import java.util.List;
  9 +
  10 +/**
  11 + * 生产科对账单应收账单(ProducePaymentCheckBillOrder)实体类
  12 + *
  13 + * @author makejava
  14 + * @since 2024-08-05 16:26:35
  15 + */
  16 +@Data
  17 +@AllArgsConstructor
  18 +@ToString
  19 +@NoArgsConstructor
  20 +@EqualsAndHashCode(callSuper = false)
  21 +@SuperBuilder
  22 +public class ProducePaymentCheckBillOrderQueryVO extends BasePageVO implements Serializable {
  23 +
  24 + private List<Long> ids;
  25 +
  26 +
  27 + private Long id;
  28 + /**
  29 + * 生产科对账单
  30 + */
  31 + private String checkNo;
  32 + /**
  33 + * 发票url地址
  34 + */
  35 + private String invoiceUrl;
  36 + /**
  37 + * 扣款单url地址
  38 + */
  39 + private String deductPdfUrl;
  40 + /**
  41 + * 生产科应付款日期
  42 + */
  43 + private String payedDate;
  44 + /**
  45 + * 生产科扣款责任部门
  46 + */
  47 + private String deductDept;
  48 + /**
  49 + * 生产科扣款金额
  50 + */
  51 + private Double deductAmount;
  52 + /**
  53 + * 实际应付金额
  54 + */
  55 + private Double actualPayedAmount;
  56 + /**
  57 + * 总经理审核状态 0:待审核、1:审核通过,2:审核驳回
  58 + */
  59 + private Integer status;
  60 +
  61 +
  62 +}
  63 +
... ...
src/main/java/com/order/erp/domain/vo/order/ProducePaymentCheckBillOrderVO.java 0 → 100644
  1 +package com.order.erp.domain.vo.order;
  2 +
  3 +import lombok.*;
  4 +import lombok.experimental.SuperBuilder;
  5 +
  6 +import java.io.Serializable;
  7 +
  8 +/**
  9 + * 生产科对账单应收账单(ProducePaymentCheckBillOrder)实体类
  10 + *
  11 + * @author makejava
  12 + * @since 2024-08-05 16:26:35
  13 + */
  14 +@Data
  15 +@AllArgsConstructor
  16 +@ToString
  17 +@NoArgsConstructor
  18 +@EqualsAndHashCode(callSuper = false)
  19 +@SuperBuilder
  20 +public class ProducePaymentCheckBillOrderVO implements Serializable {
  21 + private static final long serialVersionUID = 239047702576286556L;
  22 +
  23 + private Long id;
  24 + /**
  25 + * 生产科对账单
  26 + */
  27 + private String checkNo;
  28 + /**
  29 + * 发票url地址
  30 + */
  31 + private String invoiceUrl;
  32 + /**
  33 + * 扣款单url地址
  34 + */
  35 + private String deductPdfUrl;
  36 + /**
  37 + * 生产科应付款日期
  38 + */
  39 + private String payedDate;
  40 + /**
  41 + * 生产科扣款责任部门
  42 + */
  43 + private String deductDept;
  44 + /**
  45 + * 生产科扣款金额
  46 + */
  47 + private Double deductAmount;
  48 + /**
  49 + * 实际应付金额
  50 + */
  51 + private Double actualPayedAmount;
  52 + /**
  53 + * 总经理审核状态 0:待审核、1:审核通过,2:审核驳回
  54 + */
  55 + private Integer status;
  56 +
  57 +
  58 +}
... ...
src/main/java/com/order/erp/mapper/order/CheckBillMappingMapper.java 0 → 100644
  1 +package com.order.erp.mapper.order;
  2 +
  3 +import com.baomidou.mybatisplus.core.mapper.BaseMapper;
  4 +import com.order.erp.domain.dto.order.CheckBillMappingDO;
  5 +
  6 +/**
  7 + * 生产科对账单应收账单映射表(CheckBillMapping)表数据库访问层
  8 + *
  9 + * @author makejava
  10 + * @since 2024-08-05 16:26:37
  11 + */
  12 +public interface CheckBillMappingMapper extends BaseMapper<CheckBillMappingDO> {
  13 +
  14 +
  15 +}
  16 +
... ...
src/main/java/com/order/erp/mapper/order/InvoiceBillMappingMapper.java 0 → 100644
  1 +package com.order.erp.mapper.order;
  2 +
  3 +import com.baomidou.mybatisplus.core.mapper.BaseMapper;
  4 +import com.order.erp.domain.dto.order.InvoiceBillMappingDO;
  5 +
  6 +/**
  7 + * 应收款账单关联订单映射表(InvoiceBillMapping)表数据库访问层
  8 + *
  9 + * @author makejava
  10 + * @since 2024-08-05 16:26:36
  11 + */
  12 +public interface InvoiceBillMappingMapper extends BaseMapper<InvoiceBillMappingDO> {
  13 +
  14 +
  15 +}
  16 +
... ...
src/main/java/com/order/erp/mapper/order/InvoiceBillOrderMapper.java 0 → 100644
  1 +package com.order.erp.mapper.order;
  2 +
  3 +import com.baomidou.mybatisplus.core.mapper.BaseMapper;
  4 +import com.order.erp.domain.dto.order.InvoiceBillOrderDO;
  5 +
  6 +/**
  7 + * 应收款账单表(InvoiceBillOrder)表数据库访问层
  8 + *
  9 + * @author makejava
  10 + * @since 2024-08-05 16:26:34
  11 + */
  12 +public interface InvoiceBillOrderMapper extends BaseMapper<InvoiceBillOrderDO> {
  13 +
  14 +
  15 +}
  16 +
... ...
src/main/java/com/order/erp/mapper/order/ProducePaymentCheckBillOrderMapper.java 0 → 100644
  1 +package com.order.erp.mapper.order;
  2 +
  3 +import com.baomidou.mybatisplus.core.mapper.BaseMapper;
  4 +import com.order.erp.domain.dto.order.ProducePaymentCheckBillOrderDO;
  5 +
  6 +/**
  7 + * 生产科对账单应收账单(ProducePaymentCheckBillOrder)表数据库访问层
  8 + *
  9 + * @author makejava
  10 + * @since 2024-08-05 16:26:35
  11 + */
  12 +public interface ProducePaymentCheckBillOrderMapper extends BaseMapper<ProducePaymentCheckBillOrderDO> {
  13 +
  14 +
  15 +}
  16 +
... ...
src/main/java/com/order/erp/service/LocalStorageService.java
... ... @@ -24,6 +24,14 @@ public interface LocalStorageService extends IService&lt;LocalStorageDO&gt; {
24 24 */
25 25 ServerResult uploadByAliOss(String name, MultipartFile file);
26 26  
  27 + /**
  28 + *
  29 + * @param name
  30 + * @param file
  31 + * @return
  32 + */
  33 + ServerResult uploadFileByAliOss(String name, MultipartFile file);
  34 +
27 35 ServerResult create(String name, MultipartFile file);
28 36  
29 37 /**
... ...
src/main/java/com/order/erp/service/impl/LocalStorageServiceImpl.java
... ... @@ -51,6 +51,24 @@ public class LocalStorageServiceImpl extends ServiceImpl&lt;LocalStorageMapper, Loc
51 51 private long maxSize;
52 52  
53 53 @Override
  54 + public ServerResult uploadFileByAliOss(String name, MultipartFile file) {
  55 + FileUtil.checkSize(maxSize, file.getSize());
  56 + String fileName = AliOssUtil.getUniqueFileName(name);
  57 + String tempFileName = "Thumbnails" + Constant.CROSS_BAR_CHARACTER + fileName;
  58 + ImageRespVO imageRespVO = new ImageRespVO();
  59 + try {
  60 + File tempFile = new File(path + "files" + File.separator + tempFileName);
  61 + if (AliOssUtil.upload(AliOssConfig.ALIYUN_BUCKET, fileName, file.getBytes())) {
  62 + FileUtil.del(tempFile);
  63 + }
  64 + return ServerResult.success(imageRespVO);
  65 + } catch (Exception e) {
  66 + log.error("上传文件异常:{}", e.getMessage());
  67 + throw new BusinessException(ServerResultCode.UPLOAD_IMAGES_ERROR);
  68 + }
  69 + }
  70 +
  71 + @Override
54 72 public ServerResult uploadByAliOss(String name, MultipartFile file) {
55 73 FileUtil.checkSize(maxSize, file.getSize());
56 74 String fileName = AliOssUtil.getUniqueFileName(name);
... ...
src/main/java/com/order/erp/service/order/CheckBillMappingService.java 0 → 100644
  1 +package com.order.erp.service.order;
  2 +
  3 +import com.baomidou.mybatisplus.extension.service.IService;
  4 +import com.order.erp.common.constant.ServerResult;
  5 +import com.order.erp.domain.dto.order.CheckBillMappingDO;
  6 +import com.order.erp.domain.vo.order.CheckBillMappingQueryVO;
  7 +import com.order.erp.domain.vo.order.CheckBillMappingVO;
  8 +
  9 +/**
  10 + * 生产科对账单应收账单映射表(CheckBillMapping)表服务接口
  11 + *
  12 + * @author makejava
  13 + * @since 2024-08-05 16:26:37
  14 + */
  15 +public interface CheckBillMappingService extends IService<CheckBillMappingDO> {
  16 +
  17 + /**
  18 + * 通过ID查询单条数据
  19 + *
  20 + * @param checkBillMappingQueryVO 主键
  21 + * @return 实例对象
  22 + */
  23 + ServerResult queryById(CheckBillMappingQueryVO checkBillMappingQueryVO);
  24 +
  25 + /**
  26 + * 分页查询
  27 + *
  28 + * @param checkBillMappingQueryVO 筛选条件
  29 + * @return 查询结果
  30 + */
  31 + ServerResult list(CheckBillMappingQueryVO checkBillMappingQueryVO);
  32 +
  33 + /**
  34 + * 新增数据
  35 + *
  36 + * @param checkBillMappingVO 数据VO
  37 + * @return 新增结果
  38 + */
  39 + ServerResult add(CheckBillMappingVO checkBillMappingVO);
  40 +
  41 + /**
  42 + * 修改数据
  43 + *
  44 + * @param checkBillMappingVO 数据VO
  45 + * @return 编辑结果
  46 + */
  47 + ServerResult edit(CheckBillMappingVO checkBillMappingVO);
  48 +
  49 + /**
  50 + * 通过主键删除数据
  51 + *
  52 + * @param checkBillMappingQueryVO 筛选条件
  53 + * @return 是否成功
  54 + */
  55 + ServerResult deleteById(CheckBillMappingQueryVO checkBillMappingQueryVO);
  56 +
  57 +}
... ...
src/main/java/com/order/erp/service/order/InvoiceBillMappingService.java 0 → 100644
  1 +package com.order.erp.service.order;
  2 +
  3 +import com.baomidou.mybatisplus.extension.service.IService;
  4 +import com.order.erp.common.constant.ServerResult;
  5 +import com.order.erp.domain.dto.order.InvoiceBillMappingDO;
  6 +import com.order.erp.domain.vo.order.InvoiceBillMappingQueryVO;
  7 +import com.order.erp.domain.vo.order.InvoiceBillMappingVO;
  8 +
  9 +/**
  10 + * 应收款账单关联订单映射表(InvoiceBillMapping)表服务接口
  11 + *
  12 + * @author makejava
  13 + * @since 2024-08-05 16:26:36
  14 + */
  15 +public interface InvoiceBillMappingService extends IService<InvoiceBillMappingDO> {
  16 +
  17 + /**
  18 + * 通过ID查询单条数据
  19 + *
  20 + * @param invoiceBillMappingQueryVO 主键
  21 + * @return 实例对象
  22 + */
  23 + ServerResult queryById(InvoiceBillMappingQueryVO invoiceBillMappingQueryVO);
  24 +
  25 + /**
  26 + * 分页查询
  27 + *
  28 + * @param invoiceBillMappingQueryVO 筛选条件
  29 + * @return 查询结果
  30 + */
  31 + ServerResult list(InvoiceBillMappingQueryVO invoiceBillMappingQueryVO);
  32 +
  33 + /**
  34 + * 新增数据
  35 + *
  36 + * @param invoiceBillMappingVO 数据VO
  37 + * @return 新增结果
  38 + */
  39 + ServerResult add(InvoiceBillMappingVO invoiceBillMappingVO);
  40 +
  41 + /**
  42 + * 修改数据
  43 + *
  44 + * @param invoiceBillMappingVO 数据VO
  45 + * @return 编辑结果
  46 + */
  47 + ServerResult edit(InvoiceBillMappingVO invoiceBillMappingVO);
  48 +
  49 + /**
  50 + * 通过主键删除数据
  51 + *
  52 + * @param invoiceBillMappingQueryVO 筛选条件
  53 + * @return 是否成功
  54 + */
  55 + ServerResult deleteById(InvoiceBillMappingQueryVO invoiceBillMappingQueryVO);
  56 +
  57 +}
... ...
src/main/java/com/order/erp/service/order/InvoiceBillOrderService.java 0 → 100644
  1 +package com.order.erp.service.order;
  2 +
  3 +import com.baomidou.mybatisplus.extension.service.IService;
  4 +import com.order.erp.common.constant.ServerResult;
  5 +import com.order.erp.domain.dto.order.InvoiceBillOrderDO;
  6 +import com.order.erp.domain.vo.order.*;
  7 +
  8 +import javax.servlet.http.HttpServletResponse;
  9 +import java.io.IOException;
  10 +
  11 +/**
  12 + * 应收款账单表(InvoiceBillOrder)表服务接口
  13 + *
  14 + * @author makejava
  15 + * @since 2024-08-05 16:26:34
  16 + */
  17 +public interface InvoiceBillOrderService extends IService<InvoiceBillOrderDO> {
  18 +
  19 + /**
  20 + * 分页查询
  21 + *
  22 + * @param invoiceBillOrderQueryVO 筛选条件
  23 + * @return 查询结果
  24 + */
  25 + ServerResult listByPage(InvoiceBillOrderQueryVO invoiceBillOrderQueryVO);
  26 +
  27 + /**
  28 + * @param queryVO
  29 + * @return
  30 + */
  31 + ServerResult listBaseOrderInfoBy(InvoiceBaseOrderQueryVO queryVO);
  32 +
  33 + /**
  34 + * @param queryVO
  35 + * @return
  36 + */
  37 + ServerResult listAnalysisBy(InvoiceBillAnalysisVO queryVO);
  38 +
  39 + /**
  40 + * @param queryVO
  41 + * @return
  42 + */
  43 + ServerResult export(HttpServletResponse response, InvoiceBillAnalysisVO queryVO) throws IOException;
  44 +
  45 + /**
  46 + * 新增数据
  47 + *
  48 + * @param createVO 数据VO
  49 + * @return 新增结果
  50 + */
  51 + ServerResult create(InvoiceBillCreateVO createVO);
  52 +
  53 + /**
  54 + *
  55 + * @param createVO
  56 + * @return
  57 + */
  58 + ServerResult getBackRefundDate(InvoiceBillCreateVO createVO);
  59 +
  60 + /**
  61 + * 更新扣款信息
  62 + *
  63 + * @param deductInfoVO 数据VO
  64 + * @return 编辑结果
  65 + */
  66 + ServerResult updateDeductInfo(InvoiceBillDeductInfoVO deductInfoVO);
  67 +
  68 + /**
  69 + * 更新其他金额信息
  70 + *
  71 + * @param amountInfoVO
  72 + * @return
  73 + */
  74 + ServerResult updateAmountInfo(InvoiceBillAmountInfoVO amountInfoVO);
  75 +
  76 + /**
  77 + * 提交审核
  78 + *
  79 + * @param commitApplyVO
  80 + * @return
  81 + */
  82 + ServerResult commitApply(InvoiceBillCommitApplyVO commitApplyVO);
  83 +
  84 + /**
  85 + * 通过主键删除数据
  86 + *
  87 + * @param invoiceBillOrderQueryVO 筛选条件
  88 + * @return 是否成功
  89 + */
  90 + ServerResult deleteById(InvoiceBillOrderQueryVO invoiceBillOrderQueryVO);
  91 +
  92 +}
... ...
src/main/java/com/order/erp/service/order/ProducePaymentCheckBillOrderService.java 0 → 100644
  1 +package com.order.erp.service.order;
  2 +
  3 +import com.baomidou.mybatisplus.extension.service.IService;
  4 +import com.order.erp.common.constant.ServerResult;
  5 +import com.order.erp.domain.dto.order.ProducePaymentCheckBillOrderDO;
  6 +import com.order.erp.domain.vo.order.ProducePaymentCheckBillOrderQueryVO;
  7 +import com.order.erp.domain.vo.order.ProducePaymentCheckBillOrderVO;
  8 +
  9 +/**
  10 + * 生产科对账单应收账单(ProducePaymentCheckBillOrder)表服务接口
  11 + *
  12 + * @author makejava
  13 + * @since 2024-08-05 16:26:35
  14 + */
  15 +public interface ProducePaymentCheckBillOrderService extends IService<ProducePaymentCheckBillOrderDO> {
  16 +
  17 + /**
  18 + * 通过ID查询单条数据
  19 + *
  20 + * @param producePaymentCheckBillOrderQueryVO 主键
  21 + * @return 实例对象
  22 + */
  23 + ServerResult queryById(ProducePaymentCheckBillOrderQueryVO producePaymentCheckBillOrderQueryVO);
  24 +
  25 + /**
  26 + * 分页查询
  27 + *
  28 + * @param producePaymentCheckBillOrderQueryVO 筛选条件
  29 + * @return 查询结果
  30 + */
  31 + ServerResult list(ProducePaymentCheckBillOrderQueryVO producePaymentCheckBillOrderQueryVO);
  32 +
  33 + /**
  34 + * 新增数据
  35 + *
  36 + * @param producePaymentCheckBillOrderVO 数据VO
  37 + * @return 新增结果
  38 + */
  39 + ServerResult add(ProducePaymentCheckBillOrderVO producePaymentCheckBillOrderVO);
  40 +
  41 + /**
  42 + * 修改数据
  43 + *
  44 + * @param producePaymentCheckBillOrderVO 数据VO
  45 + * @return 编辑结果
  46 + */
  47 + ServerResult edit(ProducePaymentCheckBillOrderVO producePaymentCheckBillOrderVO);
  48 +
  49 + /**
  50 + * 通过主键删除数据
  51 + *
  52 + * @param producePaymentCheckBillOrderQueryVO 筛选条件
  53 + * @return 是否成功
  54 + */
  55 + ServerResult deleteById(ProducePaymentCheckBillOrderQueryVO producePaymentCheckBillOrderQueryVO);
  56 +
  57 +}
... ...
src/main/java/com/order/erp/service/order/impl/CheckBillMappingServiceImpl.java 0 → 100644
  1 +package com.order.erp.service.order.impl;
  2 +
  3 +import cn.hutool.core.bean.BeanUtil;
  4 +import cn.hutool.core.collection.CollUtil;
  5 +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
  6 +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
  7 +import com.baomidou.mybatisplus.core.metadata.IPage;
  8 +import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
  9 +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
  10 +import com.order.erp.common.constant.Constant;
  11 +import com.order.erp.common.constant.ServerResult;
  12 +import com.order.erp.common.utils.PageUtils;
  13 +import com.order.erp.domain.dto.order.CheckBillMappingDO;
  14 +import com.order.erp.domain.vo.order.CheckBillMappingQueryVO;
  15 +import com.order.erp.domain.vo.order.CheckBillMappingVO;
  16 +import com.order.erp.mapper.order.CheckBillMappingMapper;
  17 +import com.order.erp.service.order.CheckBillMappingService;
  18 +import lombok.extern.slf4j.Slf4j;
  19 +import org.springframework.stereotype.Service;
  20 +
  21 +import java.util.List;
  22 +import java.util.Objects;
  23 +
  24 +/**
  25 + * 生产科对账单应收账单映射表(CheckBillMapping)表服务实现类
  26 + *
  27 + * @author makejava
  28 + * @since 2024-08-05 16:26:37
  29 + */
  30 +@Slf4j
  31 +@Service
  32 +public class CheckBillMappingServiceImpl extends ServiceImpl<CheckBillMappingMapper, CheckBillMappingDO> implements CheckBillMappingService {
  33 +
  34 +
  35 + /**
  36 + * 通过ID查询单条数据
  37 + * <p>
  38 + * checkBillMappingQueryVO 主键
  39 + *
  40 + * @return 实例对象
  41 + */
  42 + @Override
  43 + public ServerResult queryById(CheckBillMappingQueryVO checkBillMappingQueryVO) {
  44 + if (Objects.isNull(checkBillMappingQueryVO.getId())) {
  45 + return ServerResult.fail("id 不能为空");
  46 + }
  47 + CheckBillMappingDO CheckBillMappingDo = getById(checkBillMappingQueryVO.getId());
  48 + if (Objects.isNull(CheckBillMappingDo)) {
  49 + return ServerResult.success(null);
  50 + }
  51 + return ServerResult.success(BeanUtil.copyProperties(CheckBillMappingDo, CheckBillMappingVO.class));
  52 + }
  53 +
  54 + /**
  55 + * 分页查询
  56 + *
  57 + * @param checkBillMappingQueryVO 筛选条件
  58 + * @return 查询结果
  59 + */
  60 + @Override
  61 + public ServerResult list(CheckBillMappingQueryVO checkBillMappingQueryVO) {
  62 +
  63 + LambdaQueryWrapper<CheckBillMappingDO> queryWapper = new LambdaQueryWrapper<CheckBillMappingDO>()
  64 + .eq(CheckBillMappingDO::getEnableFlag, Constant.ENABLE_TEN)
  65 + .orderByDesc(CheckBillMappingDO::getId);
  66 + Page page = new Page<>(checkBillMappingQueryVO.getPage(), checkBillMappingQueryVO.getPageSize());
  67 + IPage<CheckBillMappingDO> iPage = page(page, queryWapper);
  68 + checkBillMappingQueryVO.setTotal(Long.valueOf(iPage.getTotal()).intValue());
  69 + return ServerResult.success(PageUtils.getPageReturn(null, checkBillMappingQueryVO));
  70 + }
  71 +
  72 + /**
  73 + * 新增数据
  74 + *
  75 + * @param checkBillMappingVO 实例对象
  76 + * @return 实例对象
  77 + */
  78 + @Override
  79 + public ServerResult add(CheckBillMappingVO checkBillMappingVO) {
  80 + //todo 校验
  81 + if (Objects.nonNull(checkBillMappingVO.getId())) {
  82 + checkBillMappingVO.setId(null);
  83 + }
  84 + CheckBillMappingDO checkBillMappingDo = BeanUtil.copyProperties(checkBillMappingVO, CheckBillMappingDO.class);
  85 +
  86 + save(checkBillMappingDo);
  87 +
  88 + return ServerResult.success();
  89 + }
  90 +
  91 + /**
  92 + * 修改数据
  93 + *
  94 + * @param checkBillMappingVO 实例对象
  95 + * @return 实例对象
  96 + */
  97 + @Override
  98 + public ServerResult edit(CheckBillMappingVO checkBillMappingVO) {
  99 + //todo 校验
  100 + if (Objects.isNull(checkBillMappingVO.getId())) {
  101 + return ServerResult.fail("id 不能为空");
  102 + }
  103 + CheckBillMappingDO checkBillMappingDo = BeanUtil.copyProperties(checkBillMappingVO, CheckBillMappingDO.class);
  104 +
  105 + updateById(checkBillMappingDo);
  106 +
  107 + return ServerResult.success();
  108 + }
  109 +
  110 + /**
  111 + * 通过主键删除数据
  112 + *
  113 + * @param checkBillMappingQueryVO 筛选条件
  114 + * @return 是否成功
  115 + */
  116 + @Override
  117 + public ServerResult deleteById(CheckBillMappingQueryVO checkBillMappingQueryVO) {
  118 + List<Long> ids = checkBillMappingQueryVO.getIds();
  119 + if (CollUtil.isEmpty(ids)) {
  120 + return ServerResult.fail("ids 参数不能为空");
  121 + }
  122 + List<CheckBillMappingDO> checkBillMappingList = listByIds(ids);
  123 + if (CollUtil.isEmpty(checkBillMappingList)) {
  124 + return ServerResult.success();
  125 + }
  126 + //todo 校验是否可以逻辑删除
  127 + LambdaUpdateWrapper<CheckBillMappingDO> updateWrapper = new LambdaUpdateWrapper<CheckBillMappingDO>()
  128 + .in(CheckBillMappingDO::getId, ids)
  129 + .set(CheckBillMappingDO::getEnableFlag, Constant.UNABLE_TWENTY);
  130 + update(updateWrapper);
  131 + return ServerResult.success();
  132 + }
  133 +}
... ...
src/main/java/com/order/erp/service/order/impl/InvoiceBillMappingServiceImpl.java 0 → 100644
  1 +package com.order.erp.service.order.impl;
  2 +
  3 +import cn.hutool.core.bean.BeanUtil;
  4 +import cn.hutool.core.collection.CollUtil;
  5 +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
  6 +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
  7 +import com.baomidou.mybatisplus.core.metadata.IPage;
  8 +import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
  9 +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
  10 +import com.order.erp.common.constant.Constant;
  11 +import com.order.erp.common.constant.ServerResult;
  12 +import com.order.erp.common.utils.PageUtils;
  13 +import com.order.erp.domain.dto.order.InvoiceBillMappingDO;
  14 +import com.order.erp.domain.vo.order.InvoiceBillMappingQueryVO;
  15 +import com.order.erp.domain.vo.order.InvoiceBillMappingVO;
  16 +import com.order.erp.mapper.order.InvoiceBillMappingMapper;
  17 +import com.order.erp.service.order.InvoiceBillMappingService;
  18 +import lombok.extern.slf4j.Slf4j;
  19 +import org.springframework.stereotype.Service;
  20 +
  21 +import java.util.List;
  22 +import java.util.Objects;
  23 +
  24 +/**
  25 + * 应收款账单关联订单映射表(InvoiceBillMapping)表服务实现类
  26 + *
  27 + * @author makejava
  28 + * @since 2024-08-05 16:26:36
  29 + */
  30 +@Slf4j
  31 +@Service
  32 +public class InvoiceBillMappingServiceImpl extends ServiceImpl<InvoiceBillMappingMapper, InvoiceBillMappingDO> implements InvoiceBillMappingService {
  33 +
  34 +
  35 + /**
  36 + * 通过ID查询单条数据
  37 + * <p>
  38 + * invoiceBillMappingQueryVO 主键
  39 + *
  40 + * @return 实例对象
  41 + */
  42 + @Override
  43 + public ServerResult queryById(InvoiceBillMappingQueryVO invoiceBillMappingQueryVO) {
  44 + if (Objects.isNull(invoiceBillMappingQueryVO.getId())) {
  45 + return ServerResult.fail("id 不能为空");
  46 + }
  47 + InvoiceBillMappingDO InvoiceBillMappingDo = getById(invoiceBillMappingQueryVO.getId());
  48 + if (Objects.isNull(InvoiceBillMappingDo)) {
  49 + return ServerResult.success(null);
  50 + }
  51 + return ServerResult.success(BeanUtil.copyProperties(InvoiceBillMappingDo, InvoiceBillMappingVO.class));
  52 + }
  53 +
  54 + /**
  55 + * 分页查询
  56 + *
  57 + * @param invoiceBillMappingQueryVO 筛选条件
  58 + * @return 查询结果
  59 + */
  60 + @Override
  61 + public ServerResult list(InvoiceBillMappingQueryVO invoiceBillMappingQueryVO) {
  62 +
  63 + LambdaQueryWrapper<InvoiceBillMappingDO> queryWapper = new LambdaQueryWrapper<InvoiceBillMappingDO>()
  64 + .eq(InvoiceBillMappingDO::getEnableFlag, Constant.ENABLE_TEN)
  65 + .orderByDesc(InvoiceBillMappingDO::getId);
  66 + Page page = new Page<>(invoiceBillMappingQueryVO.getPage(), invoiceBillMappingQueryVO.getPageSize());
  67 + IPage<InvoiceBillMappingDO> iPage = page(page, queryWapper);
  68 + invoiceBillMappingQueryVO.setTotal(Long.valueOf(iPage.getTotal()).intValue());
  69 + return ServerResult.success(PageUtils.getPageReturn(null, invoiceBillMappingQueryVO));
  70 + }
  71 +
  72 + /**
  73 + * 新增数据
  74 + *
  75 + * @param invoiceBillMappingVO 实例对象
  76 + * @return 实例对象
  77 + */
  78 + @Override
  79 + public ServerResult add(InvoiceBillMappingVO invoiceBillMappingVO) {
  80 + //todo 校验
  81 + if (Objects.nonNull(invoiceBillMappingVO.getId())) {
  82 + invoiceBillMappingVO.setId(null);
  83 + }
  84 + InvoiceBillMappingDO invoiceBillMappingDo = BeanUtil.copyProperties(invoiceBillMappingVO, InvoiceBillMappingDO.class);
  85 +
  86 + save(invoiceBillMappingDo);
  87 +
  88 + return ServerResult.success();
  89 + }
  90 +
  91 + /**
  92 + * 修改数据
  93 + *
  94 + * @param invoiceBillMappingVO 实例对象
  95 + * @return 实例对象
  96 + */
  97 + @Override
  98 + public ServerResult edit(InvoiceBillMappingVO invoiceBillMappingVO) {
  99 + //todo 校验
  100 + if (Objects.isNull(invoiceBillMappingVO.getId())) {
  101 + return ServerResult.fail("id 不能为空");
  102 + }
  103 + InvoiceBillMappingDO invoiceBillMappingDo = BeanUtil.copyProperties(invoiceBillMappingVO, InvoiceBillMappingDO.class);
  104 +
  105 + updateById(invoiceBillMappingDo);
  106 +
  107 + return ServerResult.success();
  108 + }
  109 +
  110 + /**
  111 + * 通过主键删除数据
  112 + *
  113 + * @param invoiceBillMappingQueryVO 筛选条件
  114 + * @return 是否成功
  115 + */
  116 + @Override
  117 + public ServerResult deleteById(InvoiceBillMappingQueryVO invoiceBillMappingQueryVO) {
  118 + List<Long> ids = invoiceBillMappingQueryVO.getIds();
  119 + if (CollUtil.isEmpty(ids)) {
  120 + return ServerResult.fail("ids 参数不能为空");
  121 + }
  122 + List<InvoiceBillMappingDO> invoiceBillMappingList = listByIds(ids);
  123 + if (CollUtil.isEmpty(invoiceBillMappingList)) {
  124 + return ServerResult.success();
  125 + }
  126 + //todo 校验是否可以逻辑删除
  127 + LambdaUpdateWrapper<InvoiceBillMappingDO> updateWrapper = new LambdaUpdateWrapper<InvoiceBillMappingDO>()
  128 + .in(InvoiceBillMappingDO::getId, ids)
  129 + .set(InvoiceBillMappingDO::getEnableFlag, Constant.UNABLE_TWENTY);
  130 + update(updateWrapper);
  131 + return ServerResult.success();
  132 + }
  133 +}
... ...
src/main/java/com/order/erp/service/order/impl/InvoiceBillOrderServiceImpl.java 0 → 100644
  1 +package com.order.erp.service.order.impl;
  2 +
  3 +import cn.hutool.core.collection.CollUtil;
  4 +import com.alibaba.fastjson.JSONObject;
  5 +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
  6 +import com.baomidou.mybatisplus.core.metadata.IPage;
  7 +import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
  8 +import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
  9 +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
  10 +import com.github.stupdit1t.excel.common.PoiWorkbookType;
  11 +import com.github.stupdit1t.excel.core.ExcelHelper;
  12 +import com.github.stupdit1t.excel.style.CellPosition;
  13 +import com.order.erp.common.constant.Constant;
  14 +import com.order.erp.common.constant.ServerResult;
  15 +import com.order.erp.common.constant.ServerResultCode;
  16 +import com.order.erp.common.exception.BusinessException;
  17 +import com.order.erp.common.utils.DateUtils;
  18 +import com.order.erp.common.utils.StringUtils;
  19 +import com.order.erp.common.utils.TransactionHelper;
  20 +import com.order.erp.config.DataScope;
  21 +import com.order.erp.domain.ApplyStatusEnum;
  22 +import com.order.erp.domain.ApplyTypeEnum;
  23 +import com.order.erp.domain.RoleEnum;
  24 +import com.order.erp.domain.dto.BaseDO;
  25 +import com.order.erp.domain.dto.SystemSettingDO;
  26 +import com.order.erp.domain.dto.order.*;
  27 +import com.order.erp.domain.vo.order.*;
  28 +import com.order.erp.mapper.order.InvoiceBillOrderMapper;
  29 +import com.order.erp.service.SystemSettingService;
  30 +import com.order.erp.service.order.*;
  31 +import lombok.extern.slf4j.Slf4j;
  32 +import org.springframework.beans.BeanUtils;
  33 +import org.springframework.stereotype.Service;
  34 +
  35 +import javax.annotation.Resource;
  36 +import javax.servlet.http.HttpServletResponse;
  37 +import java.io.IOException;
  38 +import java.math.BigDecimal;
  39 +import java.time.LocalDateTime;
  40 +import java.util.*;
  41 +import java.util.function.Function;
  42 +import java.util.stream.Collectors;
  43 +
  44 +/**
  45 + * 应收款账单表(InvoiceBillOrder)表服务实现类
  46 + *
  47 + * @author makejava
  48 + * @since 2024-08-05 16:26:34
  49 + */
  50 +@Slf4j
  51 +@Service
  52 +public class InvoiceBillOrderServiceImpl extends ServiceImpl<InvoiceBillOrderMapper, InvoiceBillOrderDO> implements InvoiceBillOrderService {
  53 +
  54 +
  55 + @Resource
  56 + private OrderBaseInfoService orderBaseInfoService;
  57 +
  58 + @Resource
  59 + private OrderProfitAnalysisService profitAnalysisService;
  60 +
  61 + @Resource
  62 + private InvoiceBillMappingService invoiceBillMappingService;
  63 +
  64 + @Resource
  65 + private OrderFieldLockApplyService orderFieldLockApplyService;
  66 +
  67 + @Resource
  68 + private SystemSettingService systemSettingService;
  69 +
  70 + @Resource
  71 + private DataScope dataScope;
  72 +
  73 + @Resource
  74 + private TransactionHelper transactionHelper;
  75 +
  76 +
  77 + /**
  78 + * 分页查询
  79 + *
  80 + * @param queryVO 筛选条件
  81 + * @return 查询结果
  82 + */
  83 + @Override
  84 + public ServerResult listByPage(InvoiceBillOrderQueryVO queryVO) {
  85 + LambdaQueryWrapper<InvoiceBillOrderDO> queryWrapper = getQueryWrapper(queryVO);
  86 + Page page = new Page<>(queryVO.getPage(), queryVO.getPageSize());
  87 + IPage<InvoiceBillOrderDO> iPage = page(page, queryWrapper);
  88 + return ServerResult.success(iPage);
  89 + }
  90 +
  91 + /**
  92 + * @param queryVO
  93 + * @return
  94 + */
  95 + private LambdaQueryWrapper<InvoiceBillOrderDO> getQueryWrapper(InvoiceBillOrderQueryVO queryVO) {
  96 + Set<Long> billOrderIds = filterBillOrderIdsBy(queryVO);
  97 + return new LambdaQueryWrapper<InvoiceBillOrderDO>()
  98 + .eq(InvoiceBillOrderDO::getEnableFlag, Constant.ENABLE_TEN)
  99 + .in(CollectionUtils.isNotEmpty(billOrderIds), InvoiceBillOrderDO::getId, billOrderIds)
  100 + .eq(StringUtils.isNotBlank(queryVO.getInvoiceNo()), InvoiceBillOrderDO::getInvoiceNo, queryVO.getInvoiceNo())
  101 + .eq(Objects.nonNull(queryVO.getStatus()), InvoiceBillOrderDO::getStatus, queryVO.getStatus())
  102 + .ge(StringUtils.isNotBlank(queryVO.getStartTime()), InvoiceBillOrderDO::getCreateTime, queryVO.getStartTime())
  103 + .le(StringUtils.isNotBlank(queryVO.getEndTime()), InvoiceBillOrderDO::getCreateTime, queryVO.getEndTime())
  104 + .orderByDesc(InvoiceBillOrderDO::getId);
  105 + }
  106 +
  107 + @Override
  108 + public ServerResult listBaseOrderInfoBy(InvoiceBaseOrderQueryVO queryVO) {
  109 + List<InvoiceBillMappingDO> mappingDOS = invoiceBillMappingService.list(new LambdaQueryWrapper<InvoiceBillMappingDO>()
  110 + .eq(BaseDO::getEnableFlag, Constant.ENABLE_TEN)
  111 + .eq(InvoiceBillMappingDO::getInvoiceNo, queryVO.getInvoiceNo()));
  112 + if (CollectionUtils.isEmpty(mappingDOS)) {
  113 + return ServerResult.success();
  114 + }
  115 + Set<Long> orderIds = mappingDOS.stream().map(InvoiceBillMappingDO::getOrderId).collect(Collectors.toSet());
  116 + return ServerResult.success(orderBaseInfoService.listByIds(orderIds));
  117 + }
  118 +
  119 + @Override
  120 + public ServerResult listAnalysisBy(InvoiceBillAnalysisVO queryVO) {
  121 + return ServerResult.success(getAnalysisResult(queryVO));
  122 + }
  123 +
  124 + @Override
  125 + public ServerResult export(HttpServletResponse response, InvoiceBillAnalysisVO queryVO) throws IOException {
  126 + InvoiceBillAnalysisResultVO resultVO = getAnalysisResult(queryVO);
  127 + if (Objects.isNull(resultVO)) {
  128 + throw new BusinessException("数据为空,不能导出!");
  129 + }
  130 + List<Map<String, Object>> list = buildExportMapVOS(resultVO);
  131 + if (CollectionUtils.isNotEmpty(list)) {
  132 + List<String> keys = new ArrayList<>(list.get(Constant.ZERO).keySet());
  133 +
  134 + ExcelHelper.opsExport(PoiWorkbookType.XLSX)
  135 + .opsSheet(list)
  136 + .opsHeader().simple().texts(keys).done()
  137 + .opsColumn().fields(keys).done()
  138 + .height(CellPosition.CELL, 750)
  139 + .done()
  140 + .export(response.getOutputStream());
  141 + }
  142 + return ServerResult.success();
  143 + }
  144 +
  145 + /**
  146 + * @param resultVO
  147 + * @return
  148 + */
  149 + private List<Map<String, Object>> buildExportMapVOS(InvoiceBillAnalysisResultVO resultVO) throws IOException {
  150 + List<InvoiceBillAnalysisExportVO> exportVOS = resultVO.getExportVOS();
  151 + List<Map<String, Object>> list = new ArrayList<>();
  152 + int i = 0;
  153 + for (InvoiceBillAnalysisExportVO exportVO : exportVOS) {
  154 + Map<String, Object> map = new LinkedHashMap<>();
  155 + map.put("编号", i++);
  156 + map.put("客户编码", exportVO.getCustomerCode());
  157 + map.put("INVOICE编码", exportVO.getInvoiceNo());
  158 + map.put("客户总金额汇总", exportVO.getCustomerTotalPrice());
  159 + map.put("客户扣款金额汇总", exportVO.getDeductAmount());
  160 + map.put("实际应收金额", exportVO.getActualReceivableAmount());
  161 + map.put("实际收款金额汇总", exportVO.getActualPayedAmount());
  162 + map.put("其他费用金额汇总", exportVO.getOtherAmount());
  163 + map.put("其他费用合计", exportVO.getOtherTotalAmount());
  164 + map.put("必须回款日期", exportVO.getBackRefundDate());
  165 + map.put("实际回款日期", exportVO.getActualRefundDate());
  166 + list.add(map);
  167 + }
  168 + Map<String, Object> map = new LinkedHashMap<>();
  169 + map.put("编号", "合计");
  170 + map.put("客户编码", "");
  171 + map.put("INVOICE编码", "");
  172 + map.put("客户总金额汇总", resultVO.getCustomerTotalPrice());
  173 + map.put("客户扣款金额汇总", resultVO.getDeductAmount());
  174 + map.put("实际应收金额", resultVO.getActualReceivableAmount());
  175 + map.put("实际收款金额汇总", resultVO.getActualPayedAmount());
  176 + map.put("其他费用金额汇总", resultVO.getOtherAmount());
  177 + map.put("其他费用合计", resultVO.getOtherTotalAmount());
  178 + map.put("必须回款日期", "");
  179 + map.put("实际回款日期", "");
  180 + list.add(map);
  181 + return list;
  182 + }
  183 +
  184 + /**
  185 + * @param queryVO
  186 + * @return
  187 + */
  188 + private InvoiceBillAnalysisResultVO getAnalysisResult(InvoiceBillAnalysisVO queryVO) {
  189 + LambdaQueryWrapper<InvoiceBillOrderDO> queryWrapper = getQueryWrapper(queryVO);
  190 + List<InvoiceBillOrderDO> invoiceBillOrderDOS = list(queryWrapper);
  191 + if (CollectionUtils.isEmpty(invoiceBillOrderDOS)) {
  192 + return null;
  193 + }
  194 + Set<Long> ids = invoiceBillOrderDOS.stream().map(InvoiceBillOrderDO::getId).collect(Collectors.toSet());
  195 + List<InvoiceBillMappingDO> invoiceBillMappingDOS = invoiceBillMappingService.list(new LambdaQueryWrapper<InvoiceBillMappingDO>().eq(BaseDO::getEnableFlag, Constant.ENABLE_TEN).in(InvoiceBillMappingDO::getInvoiceBillId, ids));
  196 + if (CollectionUtils.isEmpty(invoiceBillMappingDOS)) {
  197 + return null;
  198 + }
  199 + Map<Long, InvoiceBillMappingDO> orderBillMap = invoiceBillMappingDOS.stream().collect(Collectors.toMap(InvoiceBillMappingDO::getOrderId, Function.identity(), (x, y) -> x));
  200 + List<InvoiceOrderBaseItemVO> itemVOS = getInvoiceOrderBaseItems(orderBillMap);
  201 + Map<String, InvoiceBillOrderDO> invoiceBillOrderDOMap = invoiceBillOrderDOS.stream().collect(Collectors.toMap(InvoiceBillOrderDO::getInvoiceNo, Function.identity(), (x, y) -> x));
  202 + Map<String, List<InvoiceOrderBaseItemVO>> baseItemMap = itemVOS.stream().collect(Collectors.groupingBy(InvoiceOrderBaseItemVO::getInvoiceCode));
  203 + List<InvoiceBillAnalysisExportVO> exportVOS = wrapperAnalysisExport(invoiceBillOrderDOMap, baseItemMap);
  204 + return wrapperAnalysisResultVO(exportVOS);
  205 + }
  206 +
  207 + /**
  208 + * @param exportVOS
  209 + * @return
  210 + */
  211 + private InvoiceBillAnalysisResultVO wrapperAnalysisResultVO(List<InvoiceBillAnalysisExportVO> exportVOS) {
  212 + if (CollectionUtils.isEmpty(exportVOS)) {
  213 + return null;
  214 + }
  215 + InvoiceBillAnalysisResultVO resultVO = InvoiceBillAnalysisResultVO.builder().exportVOS(exportVOS).build();
  216 + BigDecimal customerTotalPrice = new BigDecimal(Constant.ZERO);
  217 + BigDecimal deductAmount = new BigDecimal(Constant.ZERO);
  218 + BigDecimal actualReceivableAmount = new BigDecimal(Constant.ZERO);
  219 + BigDecimal actualPayedAmount = new BigDecimal(Constant.ZERO);
  220 + BigDecimal otherAmount = new BigDecimal(Constant.ZERO);
  221 + BigDecimal otherTotalAmount = new BigDecimal(Constant.ZERO);
  222 + for (InvoiceBillAnalysisExportVO exportVO : exportVOS) {
  223 + if (Objects.nonNull(exportVO.getCustomerTotalPrice())) {
  224 + customerTotalPrice = customerTotalPrice.add(exportVO.getCustomerTotalPrice());
  225 + }
  226 + if (Objects.nonNull(exportVO.getDeductAmount())) {
  227 + deductAmount = deductAmount.add(exportVO.getDeductAmount());
  228 + }
  229 + if (Objects.nonNull(exportVO.getActualReceivableAmount())) {
  230 + actualReceivableAmount = actualReceivableAmount.add(exportVO.getActualReceivableAmount());
  231 + }
  232 + if (Objects.nonNull(exportVO.getActualPayedAmount())) {
  233 + actualPayedAmount = actualPayedAmount.add(exportVO.getActualPayedAmount());
  234 + }
  235 + if (Objects.nonNull(exportVO.getOtherAmount())) {
  236 + otherAmount = customerTotalPrice.add(exportVO.getOtherAmount());
  237 + }
  238 + if (Objects.nonNull(exportVO.getOtherTotalAmount())) {
  239 + otherTotalAmount = otherTotalAmount.add(exportVO.getOtherTotalAmount());
  240 + }
  241 + }
  242 + resultVO.setCustomerTotalPrice(customerTotalPrice);
  243 + resultVO.setDeductAmount(deductAmount);
  244 + resultVO.setActualReceivableAmount(actualReceivableAmount);
  245 + resultVO.setActualPayedAmount(actualPayedAmount);
  246 + resultVO.setOtherAmount(otherAmount);
  247 + resultVO.setOtherTotalAmount(otherTotalAmount);
  248 + return resultVO;
  249 + }
  250 +
  251 + /**
  252 + * @param invoiceBillOrderDOMap
  253 + * @param baseItemMap
  254 + * @return
  255 + */
  256 + private List<InvoiceBillAnalysisExportVO> wrapperAnalysisExport(Map<String, InvoiceBillOrderDO> invoiceBillOrderDOMap, Map<String, List<InvoiceOrderBaseItemVO>> baseItemMap) {
  257 + if (CollectionUtils.isEmpty(invoiceBillOrderDOMap)) {
  258 + return Collections.emptyList();
  259 + }
  260 + List<InvoiceBillAnalysisExportVO> results = new ArrayList<>();
  261 + for (Map.Entry<String, InvoiceBillOrderDO> entry : invoiceBillOrderDOMap.entrySet()) {
  262 + InvoiceBillOrderDO invoiceBillOrderDO = entry.getValue();
  263 + List<InvoiceBillAnalysisExportVO> exportVOS = transfer2analysisExportVO(invoiceBillOrderDO, baseItemMap);
  264 + if (CollectionUtils.isNotEmpty(exportVOS)) {
  265 + results.addAll(exportVOS);
  266 + }
  267 + }
  268 + return results;
  269 + }
  270 +
  271 + /**
  272 + * @param invoiceBillOrderDO
  273 + * @param baseItemMap
  274 + * @return
  275 + */
  276 + private List<InvoiceBillAnalysisExportVO> transfer2analysisExportVO(InvoiceBillOrderDO invoiceBillOrderDO, Map<String, List<InvoiceOrderBaseItemVO>> baseItemMap) {
  277 + List<InvoiceBillAnalysisExportVO> results = new ArrayList<>();
  278 + String invoiceNo = invoiceBillOrderDO.getInvoiceNo();
  279 + if (baseItemMap.containsKey(invoiceNo)) {
  280 + List<InvoiceOrderBaseItemVO> baseItemVOS = baseItemMap.get(invoiceNo);
  281 + Map<String, List<InvoiceOrderBaseItemVO>> listMap = baseItemVOS.stream().collect(Collectors.groupingBy(InvoiceOrderBaseItemVO::getCustomerCode));
  282 + for (Map.Entry<String, List<InvoiceOrderBaseItemVO>> entry : listMap.entrySet()) {
  283 + String customerCode = entry.getKey();
  284 + List<InvoiceOrderBaseItemVO> itemVOS = entry.getValue();
  285 + InvoiceBillAnalysisExportVO exportVO = buildAnalysisExportVO(invoiceBillOrderDO);
  286 + exportVO.setCustomerCode(customerCode);
  287 + if (CollectionUtils.isEmpty(itemVOS)) {
  288 + exportVO.setCustomerTotalPrice(new BigDecimal(Constant.ZERO));
  289 + } else {
  290 + BigDecimal customerTotalPrice = new BigDecimal(Constant.ZERO);
  291 + for (InvoiceOrderBaseItemVO itemVO : itemVOS) {
  292 + customerTotalPrice = customerTotalPrice.add(Objects.nonNull(itemVO.getCustomerTotalPrice()) ? itemVO.getCustomerTotalPrice() : new BigDecimal(Constant.ZERO));
  293 + }
  294 + exportVO.setCustomerTotalPrice(customerTotalPrice);
  295 + }
  296 + results.add(exportVO);
  297 + }
  298 + }
  299 + return results;
  300 + }
  301 +
  302 + /**
  303 + * @param invoiceBillOrderDO
  304 + * @return
  305 + */
  306 + private InvoiceBillAnalysisExportVO buildAnalysisExportVO(InvoiceBillOrderDO invoiceBillOrderDO) {
  307 + InvoiceBillAnalysisExportVO exportVO = new InvoiceBillAnalysisExportVO();
  308 + BeanUtils.copyProperties(invoiceBillOrderDO, exportVO);
  309 + BigDecimal actualPayedAmount = new BigDecimal(Constant.ZERO);
  310 + if (Objects.nonNull(invoiceBillOrderDO.getActualPayedAmount1())) {
  311 + actualPayedAmount = actualPayedAmount.add(invoiceBillOrderDO.getActualPayedAmount1());
  312 + }
  313 + if (Objects.nonNull(invoiceBillOrderDO.getActualPayedAmount2())) {
  314 + actualPayedAmount = actualPayedAmount.add(invoiceBillOrderDO.getActualPayedAmount2());
  315 + }
  316 + if (Objects.nonNull(invoiceBillOrderDO.getActualPayedAmount3())) {
  317 + actualPayedAmount = actualPayedAmount.add(invoiceBillOrderDO.getActualPayedAmount3());
  318 + }
  319 + exportVO.setActualPayedAmount(actualPayedAmount);
  320 + BigDecimal otherAmount = (Objects.nonNull(invoiceBillOrderDO.getActualReceivableAmount()) ? invoiceBillOrderDO.getActualReceivableAmount() : new BigDecimal(Constant.ZERO))
  321 + .subtract(exportVO.getActualPayedAmount());
  322 + exportVO.setOtherAmount(otherAmount);
  323 + BigDecimal otherTotalAmount = (Objects.nonNull(invoiceBillOrderDO.getActualReceivableAmount()) ? invoiceBillOrderDO.getActualReceivableAmount() : new BigDecimal(Constant.ZERO))
  324 + .subtract(exportVO.getActualPayedAmount()).subtract(otherAmount);
  325 + exportVO.setOtherTotalAmount(otherTotalAmount);
  326 + return exportVO;
  327 + }
  328 +
  329 + /**
  330 + * @param mappingDOMap
  331 + * @return
  332 + */
  333 + private List<InvoiceOrderBaseItemVO> getInvoiceOrderBaseItems(Map<Long, InvoiceBillMappingDO> mappingDOMap) {
  334 + Set<Long> orderIds = mappingDOMap.keySet();
  335 + List<OrderBaseInfoDO> orderBaseInfoDOList = orderBaseInfoService.listByIds(orderIds);
  336 + List<OrderProfitAnalysisDO> profitAnalysisDOS = profitAnalysisService.list(new LambdaQueryWrapper<OrderProfitAnalysisDO>().eq(BaseDO::getEnableFlag, Constant.ENABLE_TEN).in(OrderProfitAnalysisDO::getOrderId, orderIds));
  337 + Map<Long, OrderBaseInfoDO> orderBaseInfoDOMap = orderBaseInfoDOList.stream().collect(Collectors.toMap(OrderBaseInfoDO::getId, Function.identity(), (x, y) -> x));
  338 + Map<Long, OrderProfitAnalysisDO> profitAnalysisDOMap = profitAnalysisDOS.stream().collect(Collectors.toMap(OrderProfitAnalysisDO::getOrderId, Function.identity(), (x, y) -> x));
  339 + List<InvoiceOrderBaseItemVO> baseItemVOS = new ArrayList<>();
  340 + for (Map.Entry<Long, OrderBaseInfoDO> entry : orderBaseInfoDOMap.entrySet()) {
  341 + Long orderId = entry.getKey();
  342 + OrderBaseInfoDO baseInfoDO = entry.getValue();
  343 + InvoiceOrderBaseItemVO itemVO = InvoiceOrderBaseItemVO.builder()
  344 + .orderId(orderId)
  345 + .customerCode(baseInfoDO.getCustomerCode())
  346 + .build();
  347 + if (profitAnalysisDOMap.containsKey(orderId)) {
  348 + OrderProfitAnalysisDO profitAnalysisDO = profitAnalysisDOMap.get(orderId);
  349 + itemVO.setCustomerTotalPrice(Objects.isNull(profitAnalysisDO.getCustomerTotalPrice()) ? new BigDecimal(Constant.ZERO) : new BigDecimal(profitAnalysisDO.getCustomerTotalPrice()));
  350 + } else {
  351 + itemVO.setCustomerTotalPrice(new BigDecimal(Constant.ZERO));
  352 + }
  353 +
  354 + if (mappingDOMap.containsKey(orderId)) {
  355 + InvoiceBillMappingDO mappingDO = mappingDOMap.get(orderId);
  356 + itemVO.setInvoiceCode(mappingDO.getInvoiceNo());
  357 + }
  358 + baseItemVOS.add(itemVO);
  359 + }
  360 + return baseItemVOS;
  361 + }
  362 +
  363 + /**
  364 + * @param queryVO
  365 + * @return
  366 + */
  367 + private Set<Long> filterBillOrderIdsBy(InvoiceBillOrderQueryVO queryVO) {
  368 + List<Long> orderIds = filterOrderIdsBy(queryVO);
  369 + if (CollectionUtils.isEmpty(orderIds)) {
  370 + return null;
  371 + }
  372 + List<InvoiceBillMappingDO> mappingDOS = invoiceBillMappingService.list(new LambdaQueryWrapper<InvoiceBillMappingDO>().eq(BaseDO::getEnableFlag, Constant.ENABLE_TEN)
  373 + .in(CollectionUtils.isNotEmpty(orderIds), InvoiceBillMappingDO::getOrderId, orderIds));
  374 + if (CollectionUtils.isEmpty(mappingDOS)) {
  375 + Set<Long> ids = new HashSet<>();
  376 + ids.add(-1L);
  377 + return ids;
  378 + }
  379 + return mappingDOS.stream().map(InvoiceBillMappingDO::getInvoiceBillId).collect(Collectors.toSet());
  380 + }
  381 +
  382 + /**
  383 + * @param queryVO
  384 + * @return
  385 + */
  386 + private List<Long> filterOrderIdsBy(InvoiceBillOrderQueryVO queryVO) {
  387 + Boolean flag = false;
  388 + if (StringUtils.isNotBlank(queryVO.getCustomerCode())) {
  389 + flag = flag | true;
  390 + }
  391 + if (StringUtils.isNotBlank(queryVO.getProductionDepartment())) {
  392 + flag = flag | true;
  393 + }
  394 + if (StringUtils.isNotBlank(queryVO.getCustomerPo())) {
  395 + flag = flag | true;
  396 + }
  397 + if (StringUtils.isNotBlank(queryVO.getInnerNo())) {
  398 + flag = flag | true;
  399 + }
  400 + if (StringUtils.isNotBlank(queryVO.getProjectNo())) {
  401 + flag = flag | true;
  402 + }
  403 + if (!flag) {
  404 + return null;
  405 + }
  406 + LambdaQueryWrapper<OrderBaseInfoDO> queryWrapper = new LambdaQueryWrapper<OrderBaseInfoDO>()
  407 + .eq(OrderBaseInfoDO::getEnableFlag, Constant.ENABLE_TEN)
  408 + .eq(StringUtils.isNotBlank(queryVO.getCustomerCode()), OrderBaseInfoDO::getCustomerCode, queryVO.getCustomerCode())
  409 + .eq(StringUtils.isNotBlank(queryVO.getProductionDepartment()), OrderBaseInfoDO::getProductionDepartment, queryVO.getProductionDepartment())
  410 + .eq(StringUtils.isNotBlank(queryVO.getCustomerPo()), OrderBaseInfoDO::getCustomerPo, queryVO.getCustomerPo())
  411 + .eq(StringUtils.isNotBlank(queryVO.getInnerNo()), OrderBaseInfoDO::getInnerNo, queryVO.getInnerNo())
  412 + .eq(StringUtils.isNotBlank(queryVO.getProjectNo()), OrderBaseInfoDO::getProjectNo, queryVO.getProjectNo());
  413 + List<OrderBaseInfoDO> orderBaseInfoDOList = orderBaseInfoService.list(queryWrapper);
  414 + if (CollectionUtils.isEmpty(orderBaseInfoDOList)) {
  415 + List<Long> orderIds = new ArrayList<>();
  416 + orderIds.add(-1L);
  417 + return orderIds;
  418 + }
  419 + return orderBaseInfoDOList.stream().map(OrderBaseInfoDO::getId).collect(Collectors.toList());
  420 + }
  421 +
  422 + /**
  423 + * 创建invoice单据
  424 + *
  425 + * @param createVO 实例对象
  426 + * @return 实例对象
  427 + */
  428 + @Override
  429 + public ServerResult create(InvoiceBillCreateVO createVO) {
  430 + if (Objects.nonNull(createVO.getId())) {
  431 + createVO.setId(null);
  432 + }
  433 +
  434 + validaBillOrder(createVO);
  435 +
  436 + InvoiceBillOrderDO invoiceBillOrderDO = buildInvoiceBillOrderDO(createVO);
  437 +
  438 + transactionHelper.run(() -> {
  439 + save(invoiceBillOrderDO);
  440 +
  441 + invoiceBillMappingService.saveBatch(buildInvoiceBillMappingDOS(createVO, invoiceBillOrderDO));
  442 + });
  443 +
  444 + return ServerResult.success();
  445 + }
  446 +
  447 + @Override
  448 + public ServerResult getBackRefundDate(InvoiceBillCreateVO createVO) {
  449 + List<OrderBaseInfoDO> orderBaseInfoDOList = orderBaseInfoService.listByIds(createVO.getOrderIds());
  450 + if (CollectionUtils.isEmpty(orderBaseInfoDOList)) {
  451 + throw new BusinessException("勾选的订单信息不存在!");
  452 + }
  453 +
  454 + InvoiceHoldTimeItemVO invoiceHoldTimeItemVO = getCustomerHoldTime(orderBaseInfoDOList);
  455 +
  456 + return ServerResult.success(calculateBackRefundDate(invoiceHoldTimeItemVO));
  457 + }
  458 +
  459 + /**
  460 + * @param invoiceHoldTimeItemVO
  461 + * @return
  462 + */
  463 + private String calculateBackRefundDate(InvoiceHoldTimeItemVO invoiceHoldTimeItemVO) {
  464 + Integer holdDays = getHoldTimeByCustomerCode(invoiceHoldTimeItemVO.getCustomerCode());
  465 + LocalDateTime holdTime = DateUtils.parse(invoiceHoldTimeItemVO.getHoldTime(), DateUtils.DATE_TIME).plusDays(holdDays);
  466 + return DateUtils.format(holdTime, DateUtils.DATE);
  467 + }
  468 +
  469 + /**
  470 + * @param customerCode
  471 + * @return
  472 + */
  473 + private Integer getHoldTimeByCustomerCode(String customerCode) {
  474 + SystemSettingDO systemSettingDO = systemSettingService.getOne(new LambdaQueryWrapper<SystemSettingDO>().eq(BaseDO::getEnableFlag, Constant.ENABLE_TEN)
  475 + .eq(SystemSettingDO::getSettingCode, "customerCode").eq(SystemSettingDO::getSettingValue, customerCode)
  476 + .eq(SystemSettingDO::getRelationCode, "orderHodTime").last("limit 1"));
  477 + String holdTime = systemSettingDO.getRelationValue();
  478 + return StringUtils.isBlank(holdTime) ? Constant.ZERO : Integer.parseInt(holdTime);
  479 + }
  480 +
  481 + /**
  482 + * @param orderBaseInfoDOList
  483 + * @return
  484 + */
  485 + private InvoiceHoldTimeItemVO getCustomerHoldTime(List<OrderBaseInfoDO> orderBaseInfoDOList) {
  486 + if (CollectionUtils.isEmpty(orderBaseInfoDOList)) {
  487 + return null;
  488 + }
  489 +
  490 + Map<String, OrderBaseInfoDO> holdTimeMap = new HashMap<String, OrderBaseInfoDO>();
  491 + String maxHoldTime = null;
  492 + for (OrderBaseInfoDO baseInfoDO : orderBaseInfoDOList) {
  493 + if (StringUtils.isNotBlank(baseInfoDO.getOrderHodTime())) {
  494 + holdTimeMap.put(baseInfoDO.getOrderHodTime(), baseInfoDO);
  495 + if (StringUtils.isBlank(maxHoldTime)) {
  496 + maxHoldTime = baseInfoDO.getOrderHodTime();
  497 + } else if (maxHoldTime.compareTo(baseInfoDO.getOrderHodTime()) <= 0) {
  498 + maxHoldTime = baseInfoDO.getOrderHodTime();
  499 + }
  500 + }
  501 + }
  502 + if (StringUtils.isBlank(maxHoldTime)) {
  503 + return null;
  504 + }
  505 + InvoiceHoldTimeItemVO itemVO = new InvoiceHoldTimeItemVO();
  506 + if (holdTimeMap.containsKey(maxHoldTime)) {
  507 + OrderBaseInfoDO baseInfoDO = holdTimeMap.get(maxHoldTime);
  508 + itemVO.setCustomerCode(baseInfoDO.getCustomerCode());
  509 + itemVO.setHoldTime(maxHoldTime);
  510 + itemVO.setBaseInfoDO(baseInfoDO);
  511 + }
  512 + return itemVO;
  513 + }
  514 +
  515 + /**
  516 + * @param createVO
  517 + * @return
  518 + */
  519 + private InvoiceBillOrderDO buildInvoiceBillOrderDO(InvoiceBillCreateVO createVO) {
  520 + return InvoiceBillOrderDO.builder()
  521 + .invoiceNo(createVO.getInvoiceNo())
  522 + .bgUrl(createVO.getBgUrl())
  523 + .backRefundDate(createVO.getBackRefundDate())
  524 + .status(ApplyStatusEnum.NO_COMMIT.getStatus())
  525 + .build();
  526 + }
  527 +
  528 + /**
  529 + * @param createVO
  530 + * @param invoiceBillOrderDO
  531 + * @return
  532 + */
  533 + private List<InvoiceBillMappingDO> buildInvoiceBillMappingDOS(InvoiceBillCreateVO createVO, InvoiceBillOrderDO invoiceBillOrderDO) {
  534 + return createVO.getOrderIds().stream().map(x -> {
  535 + return InvoiceBillMappingDO.builder()
  536 + .orderId(x)
  537 + .invoiceBillId(invoiceBillOrderDO.getId())
  538 + .invoiceNo(invoiceBillOrderDO.getInvoiceNo())
  539 + .build();
  540 + }).collect(Collectors.toList());
  541 + }
  542 +
  543 + /**
  544 + * @param createVO
  545 + */
  546 + private void validaBillOrder(InvoiceBillCreateVO createVO) {
  547 + if (CollectionUtils.isEmpty(createVO.getOrderIds())) {
  548 + throw new BusinessException("请勾选订单!");
  549 + }
  550 +
  551 + List<OrderBaseInfoDO> orderBaseInfoDOList = orderBaseInfoService.listByIds(createVO.getOrderIds());
  552 + if (CollectionUtils.isEmpty(orderBaseInfoDOList)) {
  553 + throw new BusinessException("勾选的订单信息不存在!");
  554 + }
  555 +
  556 + if (orderBaseInfoDOList.size() != createVO.getOrderIds().size()) {
  557 + throw new BusinessException("勾选的订单信息有误!");
  558 + }
  559 +
  560 + String invoiceNo = createVO.getInvoiceNo();
  561 +
  562 + List<InvoiceBillOrderDO> invoiceBillOrderDOS = list(new LambdaQueryWrapper<InvoiceBillOrderDO>()
  563 + .eq(BaseDO::getEnableFlag, Constant.ENABLE_TEN)
  564 + .eq(InvoiceBillOrderDO::getInvoiceNo, invoiceNo));
  565 + if (CollectionUtils.isNotEmpty(invoiceBillOrderDOS)) {
  566 + throw new BusinessException("存在相同的invoice订单!");
  567 + }
  568 +
  569 + List<InvoiceBillMappingDO> invoiceBillMappingDOList = invoiceBillMappingService.list(new LambdaQueryWrapper<InvoiceBillMappingDO>().eq(BaseDO::getEnableFlag,Constant.ENABLE_TEN).in(InvoiceBillMappingDO::getOrderId,createVO.getOrderIds()));
  570 + if (CollectionUtils.isNotEmpty(invoiceBillMappingDOList)) {
  571 + throw new BusinessException("该勾选的订单已经绑定其他账单了!");
  572 + }
  573 + }
  574 +
  575 + /**
  576 + * 修改数据
  577 + *
  578 + * @param deductInfoVO 实例对象
  579 + * @return 实例对象
  580 + */
  581 + @Override
  582 + public ServerResult updateDeductInfo(InvoiceBillDeductInfoVO deductInfoVO) {
  583 + if (Objects.isNull(deductInfoVO.getId())) {
  584 + throw new BusinessException("id 不能为空");
  585 + }
  586 + InvoiceBillOrderDO invoiceBillOrderDo = getById(deductInfoVO.getId());
  587 + if (Objects.isNull(invoiceBillOrderDo)) {
  588 + throw new BusinessException("应收款单据不存在");
  589 + }
  590 +
  591 + checkCommitApply(invoiceBillOrderDo.getId());
  592 +
  593 + invoiceBillOrderDo.setDeductUrl(deductInfoVO.getDeductUrl());
  594 + invoiceBillOrderDo.setDeductAmount(deductInfoVO.getDeductAmount());
  595 + updateById(invoiceBillOrderDo);
  596 + return ServerResult.success();
  597 + }
  598 +
  599 + @Override
  600 + public ServerResult updateAmountInfo(InvoiceBillAmountInfoVO amountInfoVO) {
  601 + if (Objects.isNull(amountInfoVO.getId())) {
  602 + throw new BusinessException("id 不能为空");
  603 + }
  604 + InvoiceBillOrderDO invoiceBillOrderDo = getById(amountInfoVO.getId());
  605 + if (Objects.isNull(invoiceBillOrderDo)) {
  606 + throw new BusinessException("应收款单据不存在");
  607 + }
  608 +
  609 + checkCommitApply(invoiceBillOrderDo.getId());
  610 +
  611 + invoiceBillOrderDo.setBgUrl(amountInfoVO.getBgUrl());
  612 + invoiceBillOrderDo.setActualReceivableAmount(amountInfoVO.getActualReceivableAmount());
  613 + invoiceBillOrderDo.setActualPayedAmount1(amountInfoVO.getActualPayedAmount1());
  614 + invoiceBillOrderDo.setActualPayedAmount2(amountInfoVO.getActualPayedAmount2());
  615 + invoiceBillOrderDo.setActualPayedAmount3(amountInfoVO.getActualPayedAmount3());
  616 + invoiceBillOrderDo.setOtherAmount(amountInfoVO.getOtherAmount());
  617 + updateById(invoiceBillOrderDo);
  618 + return ServerResult.success();
  619 + }
  620 +
  621 + /**
  622 + * @param id
  623 + */
  624 + private void checkCommitApply(Long id) {
  625 + OrderFieldLockApplyDO applyDO = orderFieldLockApplyService.getOne(new LambdaQueryWrapper<OrderFieldLockApplyDO>()
  626 + .eq(OrderFieldLockApplyDO::getEnableFlag, Constant.ENABLE_TEN)
  627 + .eq(OrderFieldLockApplyDO::getStatus, ApplyStatusEnum.WAIT_AUDIT.getStatus())
  628 + .eq(OrderFieldLockApplyDO::getOrderId, id).last("limit 1"));
  629 + if (Objects.nonNull(applyDO)) {
  630 + throw new BusinessException("该账单还在审批中,请联系总经理审批后操作!");
  631 + }
  632 + }
  633 +
  634 + @Override
  635 + public ServerResult commitApply(InvoiceBillCommitApplyVO commitApplyVO) {
  636 + InvoiceBillOrderDO invoiceBillOrderDO = getById(commitApplyVO.getId());
  637 + if (Objects.isNull(invoiceBillOrderDO)) {
  638 + throw new BusinessException("账单不存在!");
  639 + }
  640 + Long userId = dataScope.getLoginUserId();
  641 + checkApply(commitApplyVO, userId);
  642 +
  643 + OrderFieldLockApplyDO applyDO = initOrderFieldLockApplyDO(invoiceBillOrderDO, userId);
  644 + transactionHelper.run(() -> {
  645 + orderFieldLockApplyService.save(applyDO);
  646 + invoiceBillOrderDO.setStatus(ApplyStatusEnum.WAIT_AUDIT.getStatus());
  647 + invoiceBillOrderDO.setActualRefundDate(DateUtils.format(LocalDateTime.now(), DateUtils.DATE));
  648 + updateById(invoiceBillOrderDO);
  649 + });
  650 + return ServerResult.success();
  651 + }
  652 +
  653 + /**
  654 + * @param commitApplyVO
  655 + * @param userId
  656 + */
  657 + private void checkApply(InvoiceBillCommitApplyVO commitApplyVO, Long userId) {
  658 + List<OrderFieldLockApplyDO> applyDOS = orderFieldLockApplyService.list(new LambdaQueryWrapper<OrderFieldLockApplyDO>()
  659 + .eq(BaseDO::getEnableFlag, Constant.ENABLE_TEN)
  660 + .eq(OrderFieldLockApplyDO::getOrderId, commitApplyVO.getId())
  661 + .eq(OrderFieldLockApplyDO::getApplyUserId, userId)
  662 + .eq(OrderFieldLockApplyDO::getType, ApplyTypeEnum.INVOICE_BILL_APPLY.getType())
  663 + .eq(OrderFieldLockApplyDO::getStatus, ApplyStatusEnum.WAIT_AUDIT.getStatus()));
  664 + if (CollectionUtils.isNotEmpty(applyDOS)) {
  665 + throw new BusinessException(ServerResultCode.APPLY_UNLOCK_FIELD_EXIST);
  666 + }
  667 + }
  668 +
  669 + /**
  670 + * @param invoiceBillOrderDO
  671 + * @param userId
  672 + * @return
  673 + */
  674 + private OrderFieldLockApplyDO initOrderFieldLockApplyDO(InvoiceBillOrderDO invoiceBillOrderDO, Long userId) {
  675 + OrderLockFieldVO lockFieldVO = new OrderLockFieldVO();
  676 + BeanUtils.copyProperties(invoiceBillOrderDO, lockFieldVO);
  677 + return OrderFieldLockApplyDO.builder()
  678 + .applyUserId(userId)
  679 + .auditUserId(null)
  680 + .fields(JSONObject.toJSONString(lockFieldVO))
  681 + .orderId(invoiceBillOrderDO.getId())
  682 + .type(ApplyTypeEnum.INVOICE_BILL_APPLY.getType())
  683 + .remark(ApplyTypeEnum.INVOICE_BILL_APPLY.getDesc())
  684 + .status(ApplyStatusEnum.WAIT_AUDIT.getStatus())
  685 + .auditRoleCodes(RoleEnum.BUSINESS_USER.getCode() + Constant.COMMA_CHARACTER + RoleEnum.ADMIN.getCode())
  686 + .build();
  687 + }
  688 +
  689 + /**
  690 + * 通过主键删除数据
  691 + *
  692 + * @param invoiceBillOrderQueryVO 筛选条件
  693 + * @return 是否成功
  694 + */
  695 + @Override
  696 + public ServerResult deleteById(InvoiceBillOrderQueryVO invoiceBillOrderQueryVO) {
  697 + List<Long> ids = invoiceBillOrderQueryVO.getIds();
  698 + if (CollUtil.isEmpty(ids)) {
  699 + return ServerResult.fail("ids 参数不能为空");
  700 + }
  701 + List<InvoiceBillOrderDO> invoiceBillOrderList = listByIds(ids);
  702 + if (CollUtil.isEmpty(invoiceBillOrderList)) {
  703 + return ServerResult.success();
  704 + }
  705 + transactionHelper.run(() -> {
  706 + removeByIds(ids);
  707 + invoiceBillMappingService.remove(new LambdaQueryWrapper<InvoiceBillMappingDO>().in(InvoiceBillMappingDO::getInvoiceBillId, ids));
  708 + });
  709 +
  710 + return ServerResult.success();
  711 + }
  712 +}
... ...
src/main/java/com/order/erp/service/order/impl/OrderFieldLockApplyServiceImpl.java
... ... @@ -72,6 +72,9 @@ public class OrderFieldLockApplyServiceImpl extends ServiceImpl&lt;OrderFieldLockAp
72 72 @Resource
73 73 private OrderInspectionStageService inspectionStageService;
74 74  
  75 + @Resource
  76 + private InvoiceBillOrderService invoiceBillOrderService;
  77 +
75 78 /**
76 79 * 通过ID查询单条数据
77 80 * <p>
... ... @@ -336,7 +339,7 @@ public class OrderFieldLockApplyServiceImpl extends ServiceImpl&lt;OrderFieldLockAp
336 339 .in(CollectionUtils.isNotEmpty(orderIds), OrderFieldLockApplyDO::getOrderId, orderIds);
337 340 if (Objects.isNull(roleSelect)) {
338 341 queryWrapper.like(Objects.nonNull(roleEnum), OrderFieldLockApplyDO::getAuditRoleCodes, roleEnum.getCode());
339   - }else {
  342 + } else {
340 343 queryWrapper.eq(Objects.nonNull(roleSelect), OrderFieldLockApplyDO::getAuditRoleCodes, roleSelect.getCode());
341 344  
342 345 }
... ... @@ -395,7 +398,12 @@ public class OrderFieldLockApplyServiceImpl extends ServiceImpl&lt;OrderFieldLockAp
395 398 } else if (ApplyTypeEnum.ORDER_PROFIT_APPLY.getType().equals(applyDO.getType())) {
396 399 orderBaseInfoDO.setOrderStatus(OrderStatusEnum.PROFIT_AUDIT_REFUSE.getStatus());
397 400 orderBaseInfoService.updateById(orderBaseInfoDO);
  401 + } else if (ApplyTypeEnum.INVOICE_BILL_APPLY.getType().equals(applyDO.getType())) {
  402 + InvoiceBillOrderDO invoiceBillOrderDO = JSONObject.parseObject(applyDO.getFields(), InvoiceBillOrderDO.class);
  403 + invoiceBillOrderDO.setStatus(ApplyStatusEnum.AUDIT_REFUSE.getStatus());
  404 + invoiceBillOrderService.updateById(invoiceBillOrderDO);
398 405 }
  406 +
399 407 OrderAuditLogDO auditLogDO = OrderAuditLogDO.builder().applyId(applyDO.getId()).orderId(applyDO.getOrderId()).optType(ApplyStatusEnum.AUDIT_REFUSE.getDesc()).build();
400 408  
401 409 applyService.updateById(applyDO);
... ... @@ -516,6 +524,10 @@ public class OrderFieldLockApplyServiceImpl extends ServiceImpl&lt;OrderFieldLockAp
516 524 }
517 525 orderBaseInfoDO.setOrderStatus(OrderStatusEnum.PROFIT_AUDIT_PASS.getStatus());
518 526 orderBaseInfoService.updateById(orderBaseInfoDO);
  527 + } else if (ApplyTypeEnum.INVOICE_BILL_APPLY.getType().equals(applyDO.getType())) {
  528 + InvoiceBillOrderDO invoiceBillOrderDO = JSONObject.parseObject(applyDO.getFields(), InvoiceBillOrderDO.class);
  529 + invoiceBillOrderDO.setStatus(ApplyStatusEnum.AUDIT_PASS.getStatus());
  530 + invoiceBillOrderService.updateById(invoiceBillOrderDO);
519 531 }
520 532  
521 533 OrderAuditLogDO auditLogDO = OrderAuditLogDO.builder().applyId(applyDO.getId()).orderId(applyDO.getOrderId()).optType(ApplyStatusEnum.AUDIT_PASS.getDesc()).build();
... ...
src/main/java/com/order/erp/service/order/impl/ProducePaymentCheckBillOrderServiceImpl.java 0 → 100644
  1 +package com.order.erp.service.order.impl;
  2 +
  3 +import cn.hutool.core.bean.BeanUtil;
  4 +import cn.hutool.core.collection.CollUtil;
  5 +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
  6 +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
  7 +import com.baomidou.mybatisplus.core.metadata.IPage;
  8 +import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
  9 +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
  10 +import com.order.erp.common.constant.Constant;
  11 +import com.order.erp.common.constant.ServerResult;
  12 +import com.order.erp.common.utils.PageUtils;
  13 +import com.order.erp.domain.dto.order.ProducePaymentCheckBillOrderDO;
  14 +import com.order.erp.domain.vo.order.ProducePaymentCheckBillOrderQueryVO;
  15 +import com.order.erp.domain.vo.order.ProducePaymentCheckBillOrderVO;
  16 +import com.order.erp.mapper.order.ProducePaymentCheckBillOrderMapper;
  17 +import com.order.erp.service.order.ProducePaymentCheckBillOrderService;
  18 +import lombok.extern.slf4j.Slf4j;
  19 +import org.springframework.stereotype.Service;
  20 +
  21 +import java.util.List;
  22 +import java.util.Objects;
  23 +
  24 +/**
  25 + * 生产科对账单应收账单(ProducePaymentCheckBillOrder)表服务实现类
  26 + *
  27 + * @author makejava
  28 + * @since 2024-08-05 16:26:35
  29 + */
  30 +@Slf4j
  31 +@Service
  32 +public class ProducePaymentCheckBillOrderServiceImpl extends ServiceImpl<ProducePaymentCheckBillOrderMapper, ProducePaymentCheckBillOrderDO> implements ProducePaymentCheckBillOrderService {
  33 +
  34 +
  35 + /**
  36 + * 通过ID查询单条数据
  37 + * <p>
  38 + * producePaymentCheckBillOrderQueryVO 主键
  39 + *
  40 + * @return 实例对象
  41 + */
  42 + @Override
  43 + public ServerResult queryById(ProducePaymentCheckBillOrderQueryVO producePaymentCheckBillOrderQueryVO) {
  44 + if (Objects.isNull(producePaymentCheckBillOrderQueryVO.getId())) {
  45 + return ServerResult.fail("id 不能为空");
  46 + }
  47 + ProducePaymentCheckBillOrderDO ProducePaymentCheckBillOrderDo = getById(producePaymentCheckBillOrderQueryVO.getId());
  48 + if (Objects.isNull(ProducePaymentCheckBillOrderDo)) {
  49 + return ServerResult.success(null);
  50 + }
  51 + return ServerResult.success(BeanUtil.copyProperties(ProducePaymentCheckBillOrderDo, ProducePaymentCheckBillOrderVO.class));
  52 + }
  53 +
  54 + /**
  55 + * 分页查询
  56 + *
  57 + * @param producePaymentCheckBillOrderQueryVO 筛选条件
  58 + * @return 查询结果
  59 + */
  60 + @Override
  61 + public ServerResult list(ProducePaymentCheckBillOrderQueryVO producePaymentCheckBillOrderQueryVO) {
  62 +
  63 + LambdaQueryWrapper<ProducePaymentCheckBillOrderDO> queryWapper = new LambdaQueryWrapper<ProducePaymentCheckBillOrderDO>()
  64 + .eq(ProducePaymentCheckBillOrderDO::getEnableFlag, Constant.ENABLE_TEN)
  65 + .orderByDesc(ProducePaymentCheckBillOrderDO::getId);
  66 + Page page = new Page<>(producePaymentCheckBillOrderQueryVO.getPage(), producePaymentCheckBillOrderQueryVO.getPageSize());
  67 + IPage<ProducePaymentCheckBillOrderDO> iPage = page(page, queryWapper);
  68 + producePaymentCheckBillOrderQueryVO.setTotal(Long.valueOf(iPage.getTotal()).intValue());
  69 + return ServerResult.success(PageUtils.getPageReturn(null, producePaymentCheckBillOrderQueryVO));
  70 + }
  71 +
  72 + /**
  73 + * 新增数据
  74 + *
  75 + * @param producePaymentCheckBillOrderVO 实例对象
  76 + * @return 实例对象
  77 + */
  78 + @Override
  79 + public ServerResult add(ProducePaymentCheckBillOrderVO producePaymentCheckBillOrderVO) {
  80 + //todo 校验
  81 + if (Objects.nonNull(producePaymentCheckBillOrderVO.getId())) {
  82 + producePaymentCheckBillOrderVO.setId(null);
  83 + }
  84 + ProducePaymentCheckBillOrderDO producePaymentCheckBillOrderDo = BeanUtil.copyProperties(producePaymentCheckBillOrderVO, ProducePaymentCheckBillOrderDO.class);
  85 +
  86 + save(producePaymentCheckBillOrderDo);
  87 +
  88 + return ServerResult.success();
  89 + }
  90 +
  91 + /**
  92 + * 修改数据
  93 + *
  94 + * @param producePaymentCheckBillOrderVO 实例对象
  95 + * @return 实例对象
  96 + */
  97 + @Override
  98 + public ServerResult edit(ProducePaymentCheckBillOrderVO producePaymentCheckBillOrderVO) {
  99 + //todo 校验
  100 + if (Objects.isNull(producePaymentCheckBillOrderVO.getId())) {
  101 + return ServerResult.fail("id 不能为空");
  102 + }
  103 + ProducePaymentCheckBillOrderDO producePaymentCheckBillOrderDo = BeanUtil.copyProperties(producePaymentCheckBillOrderVO, ProducePaymentCheckBillOrderDO.class);
  104 +
  105 + updateById(producePaymentCheckBillOrderDo);
  106 +
  107 + return ServerResult.success();
  108 + }
  109 +
  110 + /**
  111 + * 通过主键删除数据
  112 + *
  113 + * @param producePaymentCheckBillOrderQueryVO 筛选条件
  114 + * @return 是否成功
  115 + */
  116 + @Override
  117 + public ServerResult deleteById(ProducePaymentCheckBillOrderQueryVO producePaymentCheckBillOrderQueryVO) {
  118 + List<Long> ids = producePaymentCheckBillOrderQueryVO.getIds();
  119 + if (CollUtil.isEmpty(ids)) {
  120 + return ServerResult.fail("ids 参数不能为空");
  121 + }
  122 + List<ProducePaymentCheckBillOrderDO> producePaymentCheckBillOrderList = listByIds(ids);
  123 + if (CollUtil.isEmpty(producePaymentCheckBillOrderList)) {
  124 + return ServerResult.success();
  125 + }
  126 + //todo 校验是否可以逻辑删除
  127 + LambdaUpdateWrapper<ProducePaymentCheckBillOrderDO> updateWrapper = new LambdaUpdateWrapper<ProducePaymentCheckBillOrderDO>()
  128 + .in(ProducePaymentCheckBillOrderDO::getId, ids)
  129 + .set(ProducePaymentCheckBillOrderDO::getEnableFlag, Constant.UNABLE_TWENTY);
  130 + update(updateWrapper);
  131 + return ServerResult.success();
  132 + }
  133 +}
... ...