Compare commits
No commits in common. "b582d62a7bcedad37221c9974030de1a7ec0bb61" and "b06a6a1fdda2871154cee78f7a145856768872c0" have entirely different histories.
b582d62a7b
...
b06a6a1fdd
@ -1,87 +0,0 @@
|
|||||||
---
|
|
||||||
paths: erp-turbo-*/**/*.java
|
|
||||||
---
|
|
||||||
# ERPTurbo 项目规则
|
|
||||||
|
|
||||||
## 模块架构
|
|
||||||
|
|
||||||
ERPTurbo 项目包含两个主要模块:
|
|
||||||
|
|
||||||
- **erp-turbo-business** - 主要业务模块(**仅操作此模块**)
|
|
||||||
- **erp-turbo-svc** - 旧版服务模块(**禁止操作**)
|
|
||||||
|
|
||||||
### 重要规则
|
|
||||||
|
|
||||||
⚠️ **绝对不要修改 `erp-turbo-svc` 模块下的任何文件**
|
|
||||||
|
|
||||||
所有代码变更都应该在 `erp-turbo-business` 模块中进行。
|
|
||||||
|
|
||||||
## 目录结构
|
|
||||||
|
|
||||||
```
|
|
||||||
ERPTurbo_Server/
|
|
||||||
├── erp-turbo-business/ # 主业务模块 ✅ 可操作
|
|
||||||
│ ├── erp-turbo-biz/ # 业务逻辑层
|
|
||||||
│ │ ├── src/main/java/
|
|
||||||
│ │ │ ├── domain/ # 领域层
|
|
||||||
│ │ │ ├── app/ # 应用层
|
|
||||||
│ │ │ └── infrastructure/ # 基础设施层
|
|
||||||
│ └── erp-turbo-api/ # API 定义层
|
|
||||||
│
|
|
||||||
└── erp-turbo-svc/ # 聚合服务模块自动生成 ❌ 禁止操作
|
|
||||||
├── erp-turbo-biz/
|
|
||||||
└── erp-turbo-api/
|
|
||||||
```
|
|
||||||
|
|
||||||
## 文件路径规范
|
|
||||||
|
|
||||||
在进行字段添加、枚举添加等操作时,**仅处理以下路径**:
|
|
||||||
|
|
||||||
### API 层(erp-turbo-business/erp-turbo-api)
|
|
||||||
```
|
|
||||||
erp-turbo-common/erp-turbo-api/src/main/java/com/xunhong/erp/turbo/api/biz/dto/
|
|
||||||
├── cmd/ # 命令对象(CreateCmd, UpdateCmd, DestroyCmd)
|
|
||||||
├── vo/ # 视图对象
|
|
||||||
├── qry/ # 查询对象
|
|
||||||
├── common/ # 通用对象
|
|
||||||
└── enums/ # 枚举类
|
|
||||||
```
|
|
||||||
|
|
||||||
### Domain 层(erp-turbo-business/erp-turbo-biz)
|
|
||||||
```
|
|
||||||
erp-turbo-business/erp-turbo-biz/src/main/java/com/xunhong/erp/turbo/biz/
|
|
||||||
├── domain/ # 领域实体
|
|
||||||
└── infrastructure/
|
|
||||||
├── entity/ # DO 实体
|
|
||||||
├── mapper/ # MyBatis Mapper
|
|
||||||
└── convert/ # 对象转换器
|
|
||||||
```
|
|
||||||
|
|
||||||
### 禁止操作的路径
|
|
||||||
```
|
|
||||||
❌ erp-turbo-svc/
|
|
||||||
```
|
|
||||||
|
|
||||||
## 示例
|
|
||||||
|
|
||||||
### ✅ 正确操作
|
|
||||||
添加字段到 OrderShip:
|
|
||||||
- `erp-turbo-business/erp-turbo-biz/.../entity/OrderShipDO.java`
|
|
||||||
- `erp-turbo-business/erp-turbo-biz/.../domain/entity/OrderShip.java`
|
|
||||||
- `erp-turbo-common/erp-turbo-api/.../vo/OrderShipVO.java`
|
|
||||||
|
|
||||||
### ❌ 错误操作
|
|
||||||
- `erp-turbo-svc/erp-turbo-biz/.../entity/OrderShipDO.java` ❌
|
|
||||||
- `erp-turbo-svc/erp-turbo-biz/.../domain/entity/OrderShip.java` ❌
|
|
||||||
|
|
||||||
## 文件搜索策略
|
|
||||||
|
|
||||||
使用 Glob/Grep 工具时,应排除 `erp-turbo-svc` 目录:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# 错误示例
|
|
||||||
**/*OrderShip*.java
|
|
||||||
|
|
||||||
# 正确示例(使用路径限制)
|
|
||||||
erp-turbo-business/**/*OrderShip*.java
|
|
||||||
```
|
|
||||||
@ -1,201 +0,0 @@
|
|||||||
---
|
|
||||||
name: "add-enum-field"
|
|
||||||
description: "Add enum field to ERPTurbo project entities following DDD layered architecture. Automatically creates enum class, updates DO, VO, Cmd, and Domain Entity with proper type mapping and MyBatis annotations."
|
|
||||||
---
|
|
||||||
|
|
||||||
# Add Enum Field
|
|
||||||
|
|
||||||
为 ERPTurbo 项目实体添加枚举字段,遵循 DDD 分层架构规范。
|
|
||||||
|
|
||||||
## ⚠️ 重要规则
|
|
||||||
|
|
||||||
**仅操作 `erp-turbo-business` 模块,禁止修改 `erp-turbo-svc` 模块!**
|
|
||||||
|
|
||||||
详见:`.claude/PROJECT_RULES.md`
|
|
||||||
|
|
||||||
## 工作流程
|
|
||||||
|
|
||||||
## 输入格式
|
|
||||||
|
|
||||||
```
|
|
||||||
Enum: EnumName | value1:description1, value2:description2, ... | fieldName | fieldComment
|
|
||||||
```
|
|
||||||
|
|
||||||
**示例:**
|
|
||||||
```
|
|
||||||
Enum: DealerAccountRecordTargetType | 1:产地采购发货单,2:市场采购发货单,3:市场调货发货单 | targetType | 变动类型
|
|
||||||
```
|
|
||||||
|
|
||||||
## 工作流程
|
|
||||||
|
|
||||||
### 1. 创建枚举类
|
|
||||||
路径:`erp-turbo-api/src/main/java/com/xunhong/erp/turbo/api/biz/dto/enums/`
|
|
||||||
|
|
||||||
```java
|
|
||||||
@Getter
|
|
||||||
@RequiredArgsConstructor
|
|
||||||
public enum YourEnumName {
|
|
||||||
VALUE1(1, "描述1"),
|
|
||||||
VALUE2(2, "描述2");
|
|
||||||
|
|
||||||
@EnumValue
|
|
||||||
private final Integer type;
|
|
||||||
|
|
||||||
private final String message;
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
### 2. 更新相关文件(仅限 erp-turbo-business 模块)
|
|
||||||
|
|
||||||
| 文件路径 | 类型 | 修改内容 |
|
|
||||||
|---------|------|---------|
|
|
||||||
| `erp-turbo-business/erp-turbo-biz/.../entity/*DO.java` | Entity | 添加枚举类型字段 + `@TableField` |
|
|
||||||
| `erp-turbo-common/erp-turbo-api/.../vo/*VO.java` | VO | 添加枚举类型字段 + `@Schema` |
|
|
||||||
| `erp-turbo-common/erp-turbo-api/.../cmd/*CreateCmd.java` | CMD | 添加枚举类型字段 + `@Schema` |
|
|
||||||
| `erp-turbo-common/erp-turbo-api/.../cmd/*UpdateCmd.java` | CMD | 添加枚举类型字段 + `@Schema` |
|
|
||||||
| `erp-turbo-business/erp-turbo-biz/.../domain/entity/*.java` | Domain Entity | 添加枚举类型字段 |
|
|
||||||
|
|
||||||
⚠️ **禁止修改** `erp-turbo-svc/` 下的任何文件!
|
|
||||||
|
|
||||||
### 3. 生成 DDL
|
|
||||||
|
|
||||||
```sql
|
|
||||||
ALTER TABLE table_name
|
|
||||||
ADD COLUMN field_name TINYINT COMMENT 'field comment';
|
|
||||||
```
|
|
||||||
|
|
||||||
## 枚举设计规范
|
|
||||||
|
|
||||||
### 基本结构
|
|
||||||
```java
|
|
||||||
package com.xunhong.erp.turbo.api.biz.dto.enums;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.EnumValue;
|
|
||||||
import lombok.Getter;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
|
|
||||||
@Getter
|
|
||||||
@RequiredArgsConstructor
|
|
||||||
public enum YourEnum {
|
|
||||||
/**
|
|
||||||
* 枚举值1
|
|
||||||
*/
|
|
||||||
VALUE1(1, "描述1"),
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 枚举值2
|
|
||||||
*/
|
|
||||||
VALUE2(2, "描述2");
|
|
||||||
|
|
||||||
@EnumValue
|
|
||||||
private final Integer type;
|
|
||||||
|
|
||||||
private final String message;
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
### 实用方法(可选)
|
|
||||||
|
|
||||||
```java
|
|
||||||
/**
|
|
||||||
* 根据类型值获取枚举
|
|
||||||
*/
|
|
||||||
public static YourEnum fromType(Integer type) {
|
|
||||||
if (type == null) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
for (YourEnum value : values()) {
|
|
||||||
if (value.type.equals(type)) {
|
|
||||||
return value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据其他枚举转换
|
|
||||||
*/
|
|
||||||
public static YourEnum fromOtherEnum(OtherEnum other) {
|
|
||||||
if (other == null) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
return switch (other) {
|
|
||||||
case OTHER_VALUE1 -> VALUE1;
|
|
||||||
case OTHER_VALUE2 -> VALUE2;
|
|
||||||
default -> null;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
## 数据库类型映射
|
|
||||||
|
|
||||||
| 枚举值数量 | 数据库类型 | Java 类型 |
|
|
||||||
|----------|----------|----------|
|
|
||||||
| 1-10 | `TINYINT` | `Integer` + 枚举 |
|
|
||||||
| 11-100 | `SMALLINT` | `Integer` + 枚举 |
|
|
||||||
| 100+ | `INT` | `Integer` + 枚举 |
|
|
||||||
|
|
||||||
## 使用示例
|
|
||||||
|
|
||||||
### 示例 1:简单状态枚举
|
|
||||||
```
|
|
||||||
Enum: AuditState | 1:待审核,2:审核中,3:审核成功,4:审核驳回,5:审核取消 | state | 审核状态
|
|
||||||
```
|
|
||||||
|
|
||||||
### 示例 2:带转换方法的枚举
|
|
||||||
```
|
|
||||||
Enum: DealerAccountRecordTargetType | 1:产地采购发货单,2:市场采购发货单,3:市场调货发货单 | targetType | 变动类型
|
|
||||||
```
|
|
||||||
|
|
||||||
## 注意事项
|
|
||||||
|
|
||||||
1. **@EnumValue 注解**:MyBatis-Plus 需要此注解来识别数据库存储的枚举值
|
|
||||||
2. **Integer 类型**:枚举的存储值使用 `Integer` 而非 `int`,避免空值问题
|
|
||||||
3. **命名规范**:
|
|
||||||
- 枚举类名:`PascalCase` + `Enum` 后缀(可选)
|
|
||||||
- 枚举值:`UPPER_SNAKE_CASE`
|
|
||||||
4. **null 处理**:转换方法中正确处理 null 值
|
|
||||||
5. **业务逻辑**:复杂转换逻辑放在枚举类的静态方法中,保持业务代码整洁
|
|
||||||
|
|
||||||
## 输出示例
|
|
||||||
|
|
||||||
```
|
|
||||||
✅ 已完成枚举字段添加
|
|
||||||
========================================
|
|
||||||
创建文件:
|
|
||||||
✅ api/.../enums/YourEnum.java (erp-turbo-common)
|
|
||||||
|
|
||||||
更新文件:
|
|
||||||
✅ biz/.../entity/YourEntityDO.java (erp-turbo-business)
|
|
||||||
✅ api/.../vo/YourEntityVO.java (erp-turbo-common)
|
|
||||||
✅ api/.../cmd/YourEntityCreateCmd.java (erp-turbo-common)
|
|
||||||
✅ api/.../cmd/YourEntityUpdateCmd.java (erp-turbo-common)
|
|
||||||
✅ biz/.../domain/entity/YourEntity.java (erp-turbo-business)
|
|
||||||
|
|
||||||
⚠️ 请执行数据库迁移:
|
|
||||||
ALTER TABLE your_table
|
|
||||||
ADD COLUMN your_field TINYINT COMMENT 'your comment';
|
|
||||||
```
|
|
||||||
|
|
||||||
## 文件搜索规则
|
|
||||||
|
|
||||||
使用 Glob 工具时,**必须限制在 erp-turbo-business 模块**:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# ✅ 正确:限定路径
|
|
||||||
erp-turbo-business/**/*.java
|
|
||||||
erp-turbo-common/**/*.java
|
|
||||||
|
|
||||||
# ❌ 错误:会匹配到 svc 模块
|
|
||||||
**/*OrderShip*.java
|
|
||||||
```
|
|
||||||
|
|
||||||
使用 Grep 工具时,**排除 erp-turbo-svc 目录**:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# ✅ 正确:指定路径
|
|
||||||
grep -r "pattern" erp-turbo-business/ erp-turbo-common/
|
|
||||||
|
|
||||||
# ❌ 错误:搜索所有目录
|
|
||||||
grep -r "pattern" .
|
|
||||||
```
|
|
||||||
@ -1,78 +0,0 @@
|
|||||||
---
|
|
||||||
name: "add-database-field"
|
|
||||||
description: "Standardized field addition tool for ERPTurbo project. Automatically adds fields to DO, VO, Cmd, and Domain Entity classes with proper type mapping, annotations, and generates DDL migration script. Supports snake_case to camelCase conversion, BigDecimal for decimal types, and proper Java imports."
|
|
||||||
---
|
|
||||||
|
|
||||||
# Add Database Field
|
|
||||||
|
|
||||||
Add fields to ERPTurbo project entities following the standard DDD layered architecture.
|
|
||||||
|
|
||||||
## ⚠️ 重要规则
|
|
||||||
|
|
||||||
**仅操作 `erp-turbo-business` 模块,禁止修改 `erp-turbo-svc` 模块!**
|
|
||||||
|
|
||||||
详见:`.claude/PROJECT_RULES.md`
|
|
||||||
|
|
||||||
## Workflow
|
|
||||||
|
|
||||||
## Input Format
|
|
||||||
|
|
||||||
Provide field information in this format:
|
|
||||||
```markdown
|
|
||||||
Field: field_name | java_type | default_value | comment
|
|
||||||
```
|
|
||||||
|
|
||||||
**Example:**
|
|
||||||
```
|
|
||||||
Field: receivable_amount | BigDecimal | 0.00 | 应收金额(元)
|
|
||||||
Field: adjusted_amount | BigDecimal | 0.00 | 调整总额(元)
|
|
||||||
```
|
|
||||||
|
|
||||||
## Supported Java Types
|
|
||||||
|
|
||||||
| Database Type | Java Type | Import |
|
|
||||||
|---------------|-----------|--------|
|
|
||||||
| DECIMAL(p,s) | BigDecimal | `java.math.BigDecimal` |
|
|
||||||
| INT / BIGINT | Long | (primitive) |
|
|
||||||
| VARCHAR | String | (primitive) |
|
|
||||||
| DATETIME | LocalDateTime | `java.time.LocalDateTime` |
|
|
||||||
| DATE | LocalDate | `java.time.LocalDate` |
|
|
||||||
| BOOLEAN / TINYINT | Boolean | (primitive) |
|
|
||||||
| DOUBLE / FLOAT | Double | (primitive) |
|
|
||||||
|
|
||||||
## Workflow
|
|
||||||
|
|
||||||
1. **Locate Entity File**: Find `*DO.java` in `erp-turbo-business/erp-turbo-biz/.../infrastructure/entity/` (**跳过 erp-turbo-svc**)
|
|
||||||
2. **Find Related Files**: Locate corresponding VO, Cmd, common DTO, and domain Entity files(**仅在 erp-turbo-business 模块**)
|
|
||||||
3. **Add Import**: Add `java.math.BigDecimal` if needed
|
|
||||||
4. **Add Field**: Insert after `remark` field with proper annotations:
|
|
||||||
- DO: `@TableField(value = "snake_case_name")`
|
|
||||||
- VO: `@Schema(title = "comment")`
|
|
||||||
- Cmd: `@Schema(title = "comment")`
|
|
||||||
- Domain Entity: No annotations
|
|
||||||
5. **Generate DDL**: Output migration script
|
|
||||||
|
|
||||||
## Output Example
|
|
||||||
|
|
||||||
```
|
|
||||||
✅ 已完成字段添加
|
|
||||||
========================================
|
|
||||||
文件变更:
|
|
||||||
✅ biz/.../entity/OrderShipDO.java
|
|
||||||
✅ api/.../vo/OrderShipVO.java
|
|
||||||
✅ api/.../cmd/OrderShipCreateCmd.java
|
|
||||||
✅ api/.../cmd/OrderShipUpdateCmd.java
|
|
||||||
✅ api/.../common/OrderShip.java
|
|
||||||
✅ biz/.../domain/entity/OrderShip.java
|
|
||||||
|
|
||||||
⚠️ 请执行数据库迁移:
|
|
||||||
ALTER TABLE order_ship
|
|
||||||
ADD COLUMN receivable_amount DECIMAL(16, 2) DEFAULT 0.00 NULL COMMENT '应收金额(元)',
|
|
||||||
ADD COLUMN adjusted_amount DECIMAL(16, 2) DEFAULT 0.00 NULL COMMENT '调整总额(元)';
|
|
||||||
```
|
|
||||||
|
|
||||||
## Naming Convention
|
|
||||||
|
|
||||||
- **Database**: snake_case (e.g., `receivable_amount`)
|
|
||||||
- **Java**: camelCase (e.g., `receivableAmount`)
|
|
||||||
- **Comment**: Chinese description with unit if applicable
|
|
||||||
@ -1,313 +0,0 @@
|
|||||||
---
|
|
||||||
name: "add-state-transition"
|
|
||||||
description: "为实体添加状态流转接口(如:完成、取消等)。遵循 ERPTurbo 项目的 DDD 分层架构规范。"
|
|
||||||
---
|
|
||||||
|
|
||||||
# Add State Transition
|
|
||||||
|
|
||||||
为实体添加状态流转接口,遵循 DDD 分层架构规范。
|
|
||||||
|
|
||||||
## ⚠️ 重要规则
|
|
||||||
|
|
||||||
**仅操作 `erp-turbo-business` 和 `erp-turbo-admin` 模块,禁止修改 `erp-turbo-svc` 模块!**
|
|
||||||
|
|
||||||
详见:`.claude/PROJECT_RULES.md`
|
|
||||||
|
|
||||||
## 功能说明
|
|
||||||
|
|
||||||
为实体添加状态流转接口,例如:订单完成、对账取消、审核通过等。
|
|
||||||
|
|
||||||
## 输入格式
|
|
||||||
|
|
||||||
```
|
|
||||||
Entity: {实体名称}
|
|
||||||
Action: {操作名称}
|
|
||||||
TargetState: {目标状态值}
|
|
||||||
Comment: {操作中文描述}
|
|
||||||
```
|
|
||||||
|
|
||||||
**示例:**
|
|
||||||
```
|
|
||||||
Entity: Reconciliation
|
|
||||||
Action: Complete
|
|
||||||
TargetState: RECONCILED
|
|
||||||
Comment: 对账完成
|
|
||||||
```
|
|
||||||
|
|
||||||
## 工作流程
|
|
||||||
|
|
||||||
### 1. 创建 Cmd DTO
|
|
||||||
|
|
||||||
路径:`erp-turbo-common/erp-turbo-api/src/main/java/com/xunhong/erp/turbo/api/biz/dto/cmd/`
|
|
||||||
|
|
||||||
**文件名:** `{Entity}{Action}Cmd.java`
|
|
||||||
|
|
||||||
```java
|
|
||||||
package com.xunhong.erp.turbo.api.biz.dto.cmd;
|
|
||||||
|
|
||||||
import com.xunhong.erp.turbo.base.dto.Command;
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.EqualsAndHashCode;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author shenyifei
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@Schema(title = "{Comment}")
|
|
||||||
@EqualsAndHashCode(callSuper = true)
|
|
||||||
public class {Entity}{Action}Cmd extends Command {
|
|
||||||
|
|
||||||
@Schema(title = "{EntityComment}ID", requiredMode = Schema.RequiredMode.REQUIRED, type = "string")
|
|
||||||
private Long {entityFieldName}Id;
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
### 2. 更新 Service 接口
|
|
||||||
|
|
||||||
路径:`erp-turbo-common/erp-turbo-api/src/main/java/com/xunhong/erp/turbo/api/biz/api/{Entity}ServiceI.java`
|
|
||||||
|
|
||||||
添加方法签名:
|
|
||||||
|
|
||||||
```java
|
|
||||||
{Entity}VO {action}({Entity}{Action}Cmd {entity}{Action}Cmd);
|
|
||||||
```
|
|
||||||
|
|
||||||
### 3. 更新 Gateway 接口
|
|
||||||
|
|
||||||
路径:`erp-turbo-business/erp-turbo-biz/src/main/java/com/xunhong/erp/turbo/biz/domain/gateway/{Entity}Gateway.java`
|
|
||||||
|
|
||||||
添加方法签名:
|
|
||||||
|
|
||||||
```java
|
|
||||||
{Entity} {action}({Entity}{Action}Cmd {entity}{Action}Cmd);
|
|
||||||
```
|
|
||||||
|
|
||||||
### 4. 实现 Gateway
|
|
||||||
|
|
||||||
路径:`erp-turbo-business/erp-turbo-biz/src/main/java/com/xunhong/erp/turbo/biz/infrastructure/gateway/{Entity}GatewayImpl.java`
|
|
||||||
|
|
||||||
添加 import:
|
|
||||||
|
|
||||||
```java
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.cmd.{Entity}{Action}Cmd;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.enums.{Entity}StateEnum;
|
|
||||||
```
|
|
||||||
|
|
||||||
实现方法:
|
|
||||||
|
|
||||||
```java
|
|
||||||
@Override
|
|
||||||
public {Entity} {action}({Entity}{Action}Cmd cmd) {
|
|
||||||
LambdaQueryWrapper<{Entity}DO> queryWrapper = Wrappers.lambdaQuery({Entity}DO.class);
|
|
||||||
queryWrapper.eq({Entity}DO::get{Entity}Id, cmd.get{Entity}Id());
|
|
||||||
queryWrapper.select({Entity}DO::get{Entity}Id, {Entity}DO::getState);
|
|
||||||
queryWrapper.last("limit 1");
|
|
||||||
|
|
||||||
{Entity}DO {entity}DO = {entity}Mapper.selectOne(queryWrapper);
|
|
||||||
|
|
||||||
if (!{entity}DO.getState().equals({Entity}StateEnum.{CURRENT_STATE})) {
|
|
||||||
throw new BizException(BizErrorCode.B_BIZ_{ENTITY_UPPER}_NOT_{CURRENT_STATE_UPPER});
|
|
||||||
}
|
|
||||||
|
|
||||||
{entity}DO.setState({Entity}StateEnum.{TARGET_STATE});
|
|
||||||
{entity}Mapper.updateById({entity}DO);
|
|
||||||
|
|
||||||
return {entity}Convert.to{Entity}({entity}DO);
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
### 5. 创建 Executor
|
|
||||||
|
|
||||||
路径:`erp-turbo-business/erp-turbo-biz/src/main/java/com/xunhong/erp/turbo/biz/app/executor/cmd/{Entity}{Action}CmdExe.java`
|
|
||||||
|
|
||||||
```java
|
|
||||||
package com.xunhong.erp.turbo.biz.app.executor.cmd;
|
|
||||||
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.cmd.{Entity}{Action}Cmd;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.vo.{Entity}VO;
|
|
||||||
import com.xunhong.erp.turbo.biz.app.assembler.{Entity}Assembler;
|
|
||||||
import com.xunhong.erp.turbo.biz.domain.gateway.{Entity}Gateway;
|
|
||||||
import com.xunhong.erp.turbo.biz.domain.entity.{Entity};
|
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.springframework.stereotype.Component;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author shenyifei
|
|
||||||
*/
|
|
||||||
@Slf4j
|
|
||||||
@Component
|
|
||||||
@RequiredArgsConstructor
|
|
||||||
public class {Entity}{Action}CmdExe {
|
|
||||||
private final {Entity}Gateway {entity}Gateway;
|
|
||||||
private final {Entity}Assembler {entity}Assembler;
|
|
||||||
|
|
||||||
public {Entity}VO execute({Entity}{Action}Cmd cmd) {
|
|
||||||
{Entity} {entity} = {entity}Gateway.{action}(cmd);
|
|
||||||
return {entity}Assembler.to{Entity}VO({entity});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
### 6. 更新 ServiceImpl
|
|
||||||
|
|
||||||
路径:`erp-turbo-business/erp-turbo-biz/src/main/java/com/xunhong/erp/turbo/biz/app/service/{Entity}ServiceImpl.java`
|
|
||||||
|
|
||||||
添加字段注入:
|
|
||||||
|
|
||||||
```java
|
|
||||||
private final {Entity}{Action}CmdExe {entity}{Action}CmdExe;
|
|
||||||
```
|
|
||||||
|
|
||||||
添加方法实现:
|
|
||||||
|
|
||||||
```java
|
|
||||||
@Override
|
|
||||||
public {Entity}VO {action}({Entity}{Action}Cmd cmd) {
|
|
||||||
return {entity}{Action}CmdExe.execute(cmd);
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
### 7. 更新 Controller
|
|
||||||
|
|
||||||
路径:`erp-turbo-admin/src/main/java/com/xunhong/erp/turbo/admin/controller/{Entity}Controller.java`
|
|
||||||
|
|
||||||
添加 import:
|
|
||||||
|
|
||||||
```java
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.cmd.{Entity}{Action}Cmd;
|
|
||||||
```
|
|
||||||
|
|
||||||
添加接口方法:
|
|
||||||
|
|
||||||
```java
|
|
||||||
@SaCheckLogin
|
|
||||||
@PostMapping("{action}{Entity}")
|
|
||||||
@Operation(summary = "{Comment}", method = "POST")
|
|
||||||
public SingleResponse<{Entity}VO> {action}{Entity}(
|
|
||||||
@RequestBody @Validated {Entity}{Action}Cmd cmd) {
|
|
||||||
return SingleResponse.of({entity}Service.{action}(cmd));
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
## 命名规范
|
|
||||||
|
|
||||||
| 类型 | 格式 | 示例 |
|
|
||||||
|-----|------|-----|
|
|
||||||
| 实体名 | PascalCase | Reconciliation, Order |
|
|
||||||
| 操作名 | PascalCase | Complete, Cancel, Approve |
|
|
||||||
| 方法名 | camelCase | complete, cancel, approve |
|
|
||||||
| 字段名 | camelCase | reconciliationId, orderId |
|
|
||||||
| 常量 | UPPER_SNAKE_CASE | RECONCILIATION, ORDER |
|
|
||||||
|
|
||||||
## 使用示例
|
|
||||||
|
|
||||||
### 示例 1:对账完成
|
|
||||||
```
|
|
||||||
Entity: Reconciliation
|
|
||||||
Action: Complete
|
|
||||||
TargetState: RECONCILED
|
|
||||||
Comment: 对账完成
|
|
||||||
CurrentState: PENDING
|
|
||||||
```
|
|
||||||
|
|
||||||
生成接口:`POST /operation/completeReconciliation`
|
|
||||||
|
|
||||||
### 示例 2:订单取消
|
|
||||||
```
|
|
||||||
Entity: Order
|
|
||||||
Action: Cancel
|
|
||||||
TargetState: CANCELLED
|
|
||||||
Comment: 取消订单
|
|
||||||
CurrentState: PENDING
|
|
||||||
```
|
|
||||||
|
|
||||||
生成接口:`POST /operation/cancelOrder`
|
|
||||||
|
|
||||||
### 示例 3:审核通过
|
|
||||||
```
|
|
||||||
Entity: PaymentTask
|
|
||||||
Action: Approve
|
|
||||||
TargetState: APPROVED
|
|
||||||
Comment: 审核通过
|
|
||||||
CurrentState: PENDING_APPROVAL
|
|
||||||
```
|
|
||||||
|
|
||||||
生成接口:`POST /operation/approvePaymentTask`
|
|
||||||
|
|
||||||
## 输出示例
|
|
||||||
|
|
||||||
```
|
|
||||||
✅ 已完成状态流转接口添加
|
|
||||||
========================================
|
|
||||||
创建文件:
|
|
||||||
✅ api/.../cmd/{Entity}{Action}Cmd.java (erp-turbo-common)
|
|
||||||
✅ biz/.../executor/cmd/{Entity}{Action}CmdExe.java (erp-turbo-business)
|
|
||||||
|
|
||||||
更新文件:
|
|
||||||
✅ api/.../api/{Entity}ServiceI.java (erp-turbo-common)
|
|
||||||
✅ biz/.../gateway/{Entity}Gateway.java (erp-turbo-business)
|
|
||||||
✅ biz/.../gateway/{Entity}GatewayImpl.java (erp-turbo-business)
|
|
||||||
✅ biz/.../service/{Entity}ServiceImpl.java (erp-turbo-business)
|
|
||||||
✅ admin/.../controller/{Entity}Controller.java (erp-turbo-admin)
|
|
||||||
|
|
||||||
接口路径: POST /{basePath}/{action}{Entity}
|
|
||||||
请求体: {"{entityFieldName}Id": 123}
|
|
||||||
状态流转: {CURRENT_STATE} → {TARGET_STATE}
|
|
||||||
```
|
|
||||||
|
|
||||||
## 注意事项
|
|
||||||
|
|
||||||
1. **状态验证**:
|
|
||||||
- Gateway 实现中应验证当前状态
|
|
||||||
- 使用 `BizException` 抛出业务异常
|
|
||||||
- 错误码格式:`B_BIZ_{ENTITY}_NOT_{STATE}`
|
|
||||||
|
|
||||||
2. **查询优化**:
|
|
||||||
- 使用 `queryWrapper.select()` 只查询必要字段
|
|
||||||
- 减少数据传输和内存占用
|
|
||||||
|
|
||||||
3. **事务处理**:
|
|
||||||
- 根据需要添加 `@Transactional` 注解
|
|
||||||
- 涉及多表操作时务必使用事务
|
|
||||||
|
|
||||||
4. **接口一致性**:
|
|
||||||
- 使用 `@PostMapping`
|
|
||||||
- 使用 `@RequestBody @Validated` 接收参数
|
|
||||||
- 返回类型统一为 `SingleResponse<{Entity}VO>`
|
|
||||||
|
|
||||||
5. **权限控制**:
|
|
||||||
- 所有接口添加 `@SaCheckLogin` 注解
|
|
||||||
- 根据需要添加其他权限验证
|
|
||||||
|
|
||||||
6. **Assemble 方法**:
|
|
||||||
- 使用 `to{Entity}VO()` 而非 `toVO()`
|
|
||||||
- 保持命名一致性
|
|
||||||
|
|
||||||
## 文件搜索规则
|
|
||||||
|
|
||||||
使用 Glob 工具时,**限定在特定模块**:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# ✅ 正确:限定路径
|
|
||||||
erp-turbo-business/**/{Entity}*.java
|
|
||||||
erp-turbo-common/**/{Entity}*.java
|
|
||||||
erp-turbo-admin/**/{Entity}*.java
|
|
||||||
|
|
||||||
# ❌ 错误:会匹配到 svc 模块
|
|
||||||
**/*{Entity}*.java
|
|
||||||
```
|
|
||||||
|
|
||||||
## 常见状态流转模式
|
|
||||||
|
|
||||||
| 业务场景 | 当前状态 | 目标状态 | 操作名 |
|
|
||||||
|---------|---------|---------|--------|
|
|
||||||
| 对账完成 | PENDING | RECONCILED | Complete |
|
|
||||||
| 部分开票 | RECONCILED | PARTIAL_INVOICE | PartialInvoice |
|
|
||||||
| 完成开票 | PARTIAL_INVOICE | INVOICED | Invoice |
|
|
||||||
| 部分回款 | INVOICED | PARTIAL_PAYMENT | PartialPayment |
|
|
||||||
| 完成回款 | PARTIAL_PAYMENT | PAID | Payment |
|
|
||||||
| 订单取消 | PENDING | CANCELLED | Cancel |
|
|
||||||
| 审核通过 | PENDING | APPROVED | Approve |
|
|
||||||
| 审核驳回 | PENDING | REJECTED | Reject |
|
|
||||||
@ -1,79 +0,0 @@
|
|||||||
package com.xunhong.erp.turbo.admin.controller;
|
|
||||||
|
|
||||||
import cn.dev33.satoken.annotation.SaCheckLogin;
|
|
||||||
import com.alibaba.cola.dto.MultiResponse;
|
|
||||||
import com.alibaba.cola.dto.PageResponse;
|
|
||||||
import com.alibaba.cola.dto.Response;
|
|
||||||
import com.alibaba.cola.dto.SingleResponse;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.api.DealerAccountRecordServiceI;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.cmd.DealerAccountRecordCreateCmd;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.cmd.DealerAccountRecordDestroyCmd;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.cmd.DealerAccountRecordUpdateCmd;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.qry.DealerAccountRecordListQry;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.qry.DealerAccountRecordPageQry;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.qry.DealerAccountRecordShowQry;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.vo.DealerAccountRecordVO;
|
|
||||||
import com.xunhong.erp.turbo.base.dto.PageDTO;
|
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
import org.apache.dubbo.config.annotation.DubboReference;
|
|
||||||
import org.springframework.validation.annotation.Validated;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author shenyifei
|
|
||||||
*/
|
|
||||||
@Tag(name = "DealerAccountRecord", description = "经销商账款明细管理")
|
|
||||||
@RestController("operationDealerAccountRecordController")
|
|
||||||
@RequestMapping(value = "/operation")
|
|
||||||
@RequiredArgsConstructor
|
|
||||||
public class DealerAccountRecordController {
|
|
||||||
|
|
||||||
@DubboReference(version = "1.0.0")
|
|
||||||
private final DealerAccountRecordServiceI dealerAccountRecordService;
|
|
||||||
|
|
||||||
@SaCheckLogin
|
|
||||||
@GetMapping("listDealerAccountRecord")
|
|
||||||
@Operation(summary = "经销商账款明细列表", method = "GET")
|
|
||||||
public MultiResponse<DealerAccountRecordVO> listDealerAccountRecord(@ModelAttribute @Validated DealerAccountRecordListQry dealerAccountRecordListQry) {
|
|
||||||
return MultiResponse.of(dealerAccountRecordService.list(dealerAccountRecordListQry));
|
|
||||||
}
|
|
||||||
|
|
||||||
@SaCheckLogin
|
|
||||||
@PostMapping("createDealerAccountRecord")
|
|
||||||
@Operation(summary = "创建经销商账款明细", method = "POST")
|
|
||||||
public SingleResponse<DealerAccountRecordVO> createDealerAccountRecord(@RequestBody @Validated DealerAccountRecordCreateCmd dealerAccountRecordCreateCmd) {
|
|
||||||
return SingleResponse.of(dealerAccountRecordService.create(dealerAccountRecordCreateCmd));
|
|
||||||
}
|
|
||||||
|
|
||||||
@SaCheckLogin
|
|
||||||
@GetMapping("showDealerAccountRecord")
|
|
||||||
@Operation(summary = "经销商账款明细详情", method = "GET")
|
|
||||||
public SingleResponse<DealerAccountRecordVO> showDealerAccountRecord(@ModelAttribute @Validated DealerAccountRecordShowQry dealerAccountRecordShowQry) {
|
|
||||||
return SingleResponse.of(dealerAccountRecordService.show(dealerAccountRecordShowQry));
|
|
||||||
}
|
|
||||||
|
|
||||||
@SaCheckLogin
|
|
||||||
@GetMapping("pageDealerAccountRecord")
|
|
||||||
@Operation(summary = "经销商账款明细列表", method = "GET")
|
|
||||||
public PageResponse<DealerAccountRecordVO> pageDealerAccountRecord(@ModelAttribute @Validated DealerAccountRecordPageQry dealerAccountRecordPageQry) {
|
|
||||||
PageDTO<DealerAccountRecordVO> page = dealerAccountRecordService.page(dealerAccountRecordPageQry);
|
|
||||||
return PageResponse.of(page.getRecords(), (int) page.getTotal(), (int) page.getSize(), (int) page.getCurrent());
|
|
||||||
}
|
|
||||||
|
|
||||||
@SaCheckLogin
|
|
||||||
@RequestMapping(value = "updateDealerAccountRecord", method = {RequestMethod.PATCH, RequestMethod.PUT})
|
|
||||||
@Operation(summary = "经销商账款明细更新", method = "PATCH")
|
|
||||||
public SingleResponse<DealerAccountRecordVO> updateDealerAccountRecord(@RequestBody @Validated DealerAccountRecordUpdateCmd dealerAccountRecordUpdateCmd) {
|
|
||||||
return SingleResponse.of(dealerAccountRecordService.update(dealerAccountRecordUpdateCmd));
|
|
||||||
}
|
|
||||||
|
|
||||||
@SaCheckLogin
|
|
||||||
@DeleteMapping("destroyDealerAccountRecord")
|
|
||||||
@Operation(summary = "经销商账款明细删除", method = "DELETE")
|
|
||||||
public Response destroyDealerAccountRecord(@RequestBody @Validated DealerAccountRecordDestroyCmd dealerAccountRecordDestroyCmd) {
|
|
||||||
dealerAccountRecordService.destroy(dealerAccountRecordDestroyCmd);
|
|
||||||
return Response.buildSuccess();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,87 +0,0 @@
|
|||||||
package com.xunhong.erp.turbo.admin.controller;
|
|
||||||
|
|
||||||
import cn.dev33.satoken.annotation.SaCheckLogin;
|
|
||||||
import com.alibaba.cola.dto.MultiResponse;
|
|
||||||
import com.alibaba.cola.dto.PageResponse;
|
|
||||||
import com.alibaba.cola.dto.Response;
|
|
||||||
import com.alibaba.cola.dto.SingleResponse;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.api.ReconciliationServiceI;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.cmd.ReconciliationCompleteCmd;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.cmd.ReconciliationCreateCmd;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.cmd.ReconciliationDestroyCmd;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.cmd.ReconciliationUpdateCmd;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.qry.ReconciliationListQry;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.qry.ReconciliationPageQry;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.qry.ReconciliationShowQry;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.vo.ReconciliationVO;
|
|
||||||
import com.xunhong.erp.turbo.base.dto.PageDTO;
|
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
import org.apache.dubbo.config.annotation.DubboReference;
|
|
||||||
import org.springframework.validation.annotation.Validated;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author shenyifei
|
|
||||||
*/
|
|
||||||
@Tag(name = "Reconciliation", description = "对账管理")
|
|
||||||
@RestController("operationReconciliationController")
|
|
||||||
@RequestMapping(value = "/operation")
|
|
||||||
@RequiredArgsConstructor
|
|
||||||
public class ReconciliationController {
|
|
||||||
|
|
||||||
@DubboReference(version = "1.0.0")
|
|
||||||
private final ReconciliationServiceI reconciliationService;
|
|
||||||
|
|
||||||
@SaCheckLogin
|
|
||||||
@GetMapping("listReconciliation")
|
|
||||||
@Operation(summary = "对账列表", method = "GET")
|
|
||||||
public MultiResponse<ReconciliationVO> listReconciliation(@ModelAttribute @Validated ReconciliationListQry reconciliationListQry) {
|
|
||||||
return MultiResponse.of(reconciliationService.list(reconciliationListQry));
|
|
||||||
}
|
|
||||||
|
|
||||||
@SaCheckLogin
|
|
||||||
@PostMapping("createReconciliation")
|
|
||||||
@Operation(summary = "创建对账", method = "POST")
|
|
||||||
public SingleResponse<ReconciliationVO> createReconciliation(@RequestBody @Validated ReconciliationCreateCmd reconciliationCreateCmd) {
|
|
||||||
return SingleResponse.of(reconciliationService.create(reconciliationCreateCmd));
|
|
||||||
}
|
|
||||||
|
|
||||||
@SaCheckLogin
|
|
||||||
@GetMapping("showReconciliation")
|
|
||||||
@Operation(summary = "对账详情", method = "GET")
|
|
||||||
public SingleResponse<ReconciliationVO> showReconciliation(@ModelAttribute @Validated ReconciliationShowQry reconciliationShowQry) {
|
|
||||||
return SingleResponse.of(reconciliationService.show(reconciliationShowQry));
|
|
||||||
}
|
|
||||||
|
|
||||||
@SaCheckLogin
|
|
||||||
@GetMapping("pageReconciliation")
|
|
||||||
@Operation(summary = "对账列表", method = "GET")
|
|
||||||
public PageResponse<ReconciliationVO> pageReconciliation(@ModelAttribute @Validated ReconciliationPageQry reconciliationPageQry) {
|
|
||||||
PageDTO<ReconciliationVO> page = reconciliationService.page(reconciliationPageQry);
|
|
||||||
return PageResponse.of(page.getRecords(), (int) page.getTotal(), (int) page.getSize(), (int) page.getCurrent());
|
|
||||||
}
|
|
||||||
|
|
||||||
@SaCheckLogin
|
|
||||||
@RequestMapping(value = "updateReconciliation", method = {RequestMethod.PATCH, RequestMethod.PUT})
|
|
||||||
@Operation(summary = "对账更新", method = "PATCH")
|
|
||||||
public SingleResponse<ReconciliationVO> updateReconciliation(@RequestBody @Validated ReconciliationUpdateCmd reconciliationUpdateCmd) {
|
|
||||||
return SingleResponse.of(reconciliationService.update(reconciliationUpdateCmd));
|
|
||||||
}
|
|
||||||
|
|
||||||
@SaCheckLogin
|
|
||||||
@PostMapping("completeReconciliation")
|
|
||||||
@Operation(summary = "对账完成", method = "POST")
|
|
||||||
public SingleResponse<ReconciliationVO> completeReconciliation(@RequestBody @Validated ReconciliationCompleteCmd reconciliationCompleteCmd) {
|
|
||||||
return SingleResponse.of(reconciliationService.complete(reconciliationCompleteCmd));
|
|
||||||
}
|
|
||||||
|
|
||||||
@SaCheckLogin
|
|
||||||
@DeleteMapping("destroyReconciliation")
|
|
||||||
@Operation(summary = "对账删除", method = "DELETE")
|
|
||||||
public Response destroyReconciliation(@RequestBody @Validated ReconciliationDestroyCmd reconciliationDestroyCmd) {
|
|
||||||
reconciliationService.destroy(reconciliationDestroyCmd);
|
|
||||||
return Response.buildSuccess();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,79 +0,0 @@
|
|||||||
package com.xunhong.erp.turbo.admin.controller;
|
|
||||||
|
|
||||||
import cn.dev33.satoken.annotation.SaCheckLogin;
|
|
||||||
import com.alibaba.cola.dto.MultiResponse;
|
|
||||||
import com.alibaba.cola.dto.PageResponse;
|
|
||||||
import com.alibaba.cola.dto.Response;
|
|
||||||
import com.alibaba.cola.dto.SingleResponse;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.api.ReconciliationInvoiceServiceI;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.cmd.ReconciliationInvoiceCreateCmd;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.cmd.ReconciliationInvoiceDestroyCmd;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.cmd.ReconciliationInvoiceUpdateCmd;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.qry.ReconciliationInvoiceListQry;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.qry.ReconciliationInvoicePageQry;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.qry.ReconciliationInvoiceShowQry;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.vo.ReconciliationInvoiceVO;
|
|
||||||
import com.xunhong.erp.turbo.base.dto.PageDTO;
|
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
import org.apache.dubbo.config.annotation.DubboReference;
|
|
||||||
import org.springframework.validation.annotation.Validated;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author shenyifei
|
|
||||||
*/
|
|
||||||
@Tag(name = "ReconciliationInvoice", description = "对账发票管理")
|
|
||||||
@RestController("operationReconciliationInvoiceController")
|
|
||||||
@RequestMapping(value = "/operation")
|
|
||||||
@RequiredArgsConstructor
|
|
||||||
public class ReconciliationInvoiceController {
|
|
||||||
|
|
||||||
@DubboReference(version = "1.0.0")
|
|
||||||
private final ReconciliationInvoiceServiceI reconciliationInvoiceService;
|
|
||||||
|
|
||||||
@SaCheckLogin
|
|
||||||
@GetMapping("listReconciliationInvoice")
|
|
||||||
@Operation(summary = "对账发票列表", method = "GET")
|
|
||||||
public MultiResponse<ReconciliationInvoiceVO> listReconciliationInvoice(@ModelAttribute @Validated ReconciliationInvoiceListQry reconciliationInvoiceListQry) {
|
|
||||||
return MultiResponse.of(reconciliationInvoiceService.list(reconciliationInvoiceListQry));
|
|
||||||
}
|
|
||||||
|
|
||||||
@SaCheckLogin
|
|
||||||
@PostMapping("createReconciliationInvoice")
|
|
||||||
@Operation(summary = "创建对账发票", method = "POST")
|
|
||||||
public SingleResponse<ReconciliationInvoiceVO> createReconciliationInvoice(@RequestBody @Validated ReconciliationInvoiceCreateCmd reconciliationInvoiceCreateCmd) {
|
|
||||||
return SingleResponse.of(reconciliationInvoiceService.create(reconciliationInvoiceCreateCmd));
|
|
||||||
}
|
|
||||||
|
|
||||||
@SaCheckLogin
|
|
||||||
@GetMapping("showReconciliationInvoice")
|
|
||||||
@Operation(summary = "对账发票详情", method = "GET")
|
|
||||||
public SingleResponse<ReconciliationInvoiceVO> showReconciliationInvoice(@ModelAttribute @Validated ReconciliationInvoiceShowQry reconciliationInvoiceShowQry) {
|
|
||||||
return SingleResponse.of(reconciliationInvoiceService.show(reconciliationInvoiceShowQry));
|
|
||||||
}
|
|
||||||
|
|
||||||
@SaCheckLogin
|
|
||||||
@GetMapping("pageReconciliationInvoice")
|
|
||||||
@Operation(summary = "对账发票列表", method = "GET")
|
|
||||||
public PageResponse<ReconciliationInvoiceVO> pageReconciliationInvoice(@ModelAttribute @Validated ReconciliationInvoicePageQry reconciliationInvoicePageQry) {
|
|
||||||
PageDTO<ReconciliationInvoiceVO> page = reconciliationInvoiceService.page(reconciliationInvoicePageQry);
|
|
||||||
return PageResponse.of(page.getRecords(), (int) page.getTotal(), (int) page.getSize(), (int) page.getCurrent());
|
|
||||||
}
|
|
||||||
|
|
||||||
@SaCheckLogin
|
|
||||||
@RequestMapping(value = "updateReconciliationInvoice", method = {RequestMethod.PATCH, RequestMethod.PUT})
|
|
||||||
@Operation(summary = "对账发票更新", method = "PATCH")
|
|
||||||
public SingleResponse<ReconciliationInvoiceVO> updateReconciliationInvoice(@RequestBody @Validated ReconciliationInvoiceUpdateCmd reconciliationInvoiceUpdateCmd) {
|
|
||||||
return SingleResponse.of(reconciliationInvoiceService.update(reconciliationInvoiceUpdateCmd));
|
|
||||||
}
|
|
||||||
|
|
||||||
@SaCheckLogin
|
|
||||||
@DeleteMapping("destroyReconciliationInvoice")
|
|
||||||
@Operation(summary = "对账发票删除", method = "DELETE")
|
|
||||||
public Response destroyReconciliationInvoice(@RequestBody @Validated ReconciliationInvoiceDestroyCmd reconciliationInvoiceDestroyCmd) {
|
|
||||||
reconciliationInvoiceService.destroy(reconciliationInvoiceDestroyCmd);
|
|
||||||
return Response.buildSuccess();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,79 +0,0 @@
|
|||||||
package com.xunhong.erp.turbo.admin.controller;
|
|
||||||
|
|
||||||
import cn.dev33.satoken.annotation.SaCheckLogin;
|
|
||||||
import com.alibaba.cola.dto.MultiResponse;
|
|
||||||
import com.alibaba.cola.dto.PageResponse;
|
|
||||||
import com.alibaba.cola.dto.Response;
|
|
||||||
import com.alibaba.cola.dto.SingleResponse;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.api.ReconciliationPaymentServiceI;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.cmd.ReconciliationPaymentCreateCmd;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.cmd.ReconciliationPaymentDestroyCmd;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.cmd.ReconciliationPaymentUpdateCmd;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.qry.ReconciliationPaymentListQry;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.qry.ReconciliationPaymentPageQry;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.qry.ReconciliationPaymentShowQry;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.vo.ReconciliationPaymentVO;
|
|
||||||
import com.xunhong.erp.turbo.base.dto.PageDTO;
|
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
import org.apache.dubbo.config.annotation.DubboReference;
|
|
||||||
import org.springframework.validation.annotation.Validated;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author shenyifei
|
|
||||||
*/
|
|
||||||
@Tag(name = "ReconciliationPayment", description = "对账付款管理")
|
|
||||||
@RestController("operationReconciliationPaymentController")
|
|
||||||
@RequestMapping(value = "/operation")
|
|
||||||
@RequiredArgsConstructor
|
|
||||||
public class ReconciliationPaymentController {
|
|
||||||
|
|
||||||
@DubboReference(version = "1.0.0")
|
|
||||||
private final ReconciliationPaymentServiceI reconciliationPaymentService;
|
|
||||||
|
|
||||||
@SaCheckLogin
|
|
||||||
@GetMapping("listReconciliationPayment")
|
|
||||||
@Operation(summary = "对账付款列表", method = "GET")
|
|
||||||
public MultiResponse<ReconciliationPaymentVO> listReconciliationPayment(@ModelAttribute @Validated ReconciliationPaymentListQry reconciliationPaymentListQry) {
|
|
||||||
return MultiResponse.of(reconciliationPaymentService.list(reconciliationPaymentListQry));
|
|
||||||
}
|
|
||||||
|
|
||||||
@SaCheckLogin
|
|
||||||
@PostMapping("createReconciliationPayment")
|
|
||||||
@Operation(summary = "创建对账付款", method = "POST")
|
|
||||||
public SingleResponse<ReconciliationPaymentVO> createReconciliationPayment(@RequestBody @Validated ReconciliationPaymentCreateCmd reconciliationPaymentCreateCmd) {
|
|
||||||
return SingleResponse.of(reconciliationPaymentService.create(reconciliationPaymentCreateCmd));
|
|
||||||
}
|
|
||||||
|
|
||||||
@SaCheckLogin
|
|
||||||
@GetMapping("showReconciliationPayment")
|
|
||||||
@Operation(summary = "对账付款详情", method = "GET")
|
|
||||||
public SingleResponse<ReconciliationPaymentVO> showReconciliationPayment(@ModelAttribute @Validated ReconciliationPaymentShowQry reconciliationPaymentShowQry) {
|
|
||||||
return SingleResponse.of(reconciliationPaymentService.show(reconciliationPaymentShowQry));
|
|
||||||
}
|
|
||||||
|
|
||||||
@SaCheckLogin
|
|
||||||
@GetMapping("pageReconciliationPayment")
|
|
||||||
@Operation(summary = "对账付款列表", method = "GET")
|
|
||||||
public PageResponse<ReconciliationPaymentVO> pageReconciliationPayment(@ModelAttribute @Validated ReconciliationPaymentPageQry reconciliationPaymentPageQry) {
|
|
||||||
PageDTO<ReconciliationPaymentVO> page = reconciliationPaymentService.page(reconciliationPaymentPageQry);
|
|
||||||
return PageResponse.of(page.getRecords(), (int) page.getTotal(), (int) page.getSize(), (int) page.getCurrent());
|
|
||||||
}
|
|
||||||
|
|
||||||
@SaCheckLogin
|
|
||||||
@RequestMapping(value = "updateReconciliationPayment", method = {RequestMethod.PATCH, RequestMethod.PUT})
|
|
||||||
@Operation(summary = "对账付款更新", method = "PATCH")
|
|
||||||
public SingleResponse<ReconciliationPaymentVO> updateReconciliationPayment(@RequestBody @Validated ReconciliationPaymentUpdateCmd reconciliationPaymentUpdateCmd) {
|
|
||||||
return SingleResponse.of(reconciliationPaymentService.update(reconciliationPaymentUpdateCmd));
|
|
||||||
}
|
|
||||||
|
|
||||||
@SaCheckLogin
|
|
||||||
@DeleteMapping("destroyReconciliationPayment")
|
|
||||||
@Operation(summary = "对账付款删除", method = "DELETE")
|
|
||||||
public Response destroyReconciliationPayment(@RequestBody @Validated ReconciliationPaymentDestroyCmd reconciliationPaymentDestroyCmd) {
|
|
||||||
reconciliationPaymentService.destroy(reconciliationPaymentDestroyCmd);
|
|
||||||
return Response.buildSuccess();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
xmlns="http://maven.apache.org/POM/4.0.0"
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
|||||||
@ -1,19 +0,0 @@
|
|||||||
package com.xunhong.erp.turbo.biz.app.assembler;
|
|
||||||
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.vo.DealerAccountRecordVO;
|
|
||||||
import com.xunhong.erp.turbo.biz.domain.entity.DealerAccountRecord;
|
|
||||||
import org.mapstruct.Mapper;
|
|
||||||
import org.mapstruct.Mapping;
|
|
||||||
import org.mapstruct.NullValueCheckStrategy;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author shenyifei
|
|
||||||
*/
|
|
||||||
@Mapper(componentModel = "spring", nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS, uses = {OrderAssembler.class})
|
|
||||||
public interface DealerAccountRecordAssembler {
|
|
||||||
|
|
||||||
@Mapping(target = "orderVO", source = "order")
|
|
||||||
@Mapping(target = "orderShipVO", source = "orderShip")
|
|
||||||
@Mapping(target = "dealerVO", source = "dealer")
|
|
||||||
DealerAccountRecordVO toDealerAccountRecordVO(DealerAccountRecord dealerAccountRecord);
|
|
||||||
}
|
|
||||||
@ -1,19 +0,0 @@
|
|||||||
package com.xunhong.erp.turbo.biz.app.assembler;
|
|
||||||
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.vo.ReconciliationVO;
|
|
||||||
import com.xunhong.erp.turbo.biz.domain.entity.Reconciliation;
|
|
||||||
import org.mapstruct.Mapper;
|
|
||||||
import org.mapstruct.Mapping;
|
|
||||||
import org.mapstruct.NullValueCheckStrategy;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author shenyifei
|
|
||||||
*/
|
|
||||||
@Mapper(componentModel = "spring", nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS)
|
|
||||||
public interface ReconciliationAssembler {
|
|
||||||
|
|
||||||
@Mapping(target = "dealerVO", source = "dealer")
|
|
||||||
@Mapping(target = "companyVO", source = "company")
|
|
||||||
@Mapping(target = "orderShipVOList", source = "orderShipList")
|
|
||||||
ReconciliationVO toReconciliationVO(Reconciliation reconciliation);
|
|
||||||
}
|
|
||||||
@ -1,19 +0,0 @@
|
|||||||
package com.xunhong.erp.turbo.biz.app.assembler;
|
|
||||||
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.vo.ReconciliationInvoiceVO;
|
|
||||||
import com.xunhong.erp.turbo.biz.domain.entity.ReconciliationInvoice;
|
|
||||||
import org.mapstruct.Mapper;
|
|
||||||
import org.mapstruct.Mapping;
|
|
||||||
import org.mapstruct.NullValueCheckStrategy;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author shenyifei
|
|
||||||
*/
|
|
||||||
@Mapper(componentModel = "spring", nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS)
|
|
||||||
public interface ReconciliationInvoiceAssembler {
|
|
||||||
|
|
||||||
@Mapping(target = "dealerVO", source = "dealer")
|
|
||||||
@Mapping(target = "dealerPaymentAccountVO", source = "dealerPaymentAccount")
|
|
||||||
@Mapping(target = "companyVO", source = "company")
|
|
||||||
ReconciliationInvoiceVO toReconciliationInvoiceVO(ReconciliationInvoice reconciliationInvoice);
|
|
||||||
}
|
|
||||||
@ -1,15 +0,0 @@
|
|||||||
package com.xunhong.erp.turbo.biz.app.assembler;
|
|
||||||
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.vo.ReconciliationPaymentVO;
|
|
||||||
import com.xunhong.erp.turbo.biz.domain.entity.ReconciliationPayment;
|
|
||||||
import org.mapstruct.Mapper;
|
|
||||||
import org.mapstruct.NullValueCheckStrategy;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author shenyifei
|
|
||||||
*/
|
|
||||||
@Mapper(componentModel = "spring", nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS)
|
|
||||||
public interface ReconciliationPaymentAssembler {
|
|
||||||
|
|
||||||
ReconciliationPaymentVO toReconciliationPaymentVO(ReconciliationPayment reconciliationPayment);
|
|
||||||
}
|
|
||||||
@ -1,29 +0,0 @@
|
|||||||
package com.xunhong.erp.turbo.biz.app.executor.cmd;
|
|
||||||
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.cmd.DealerAccountRecordCreateCmd;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.vo.DealerAccountRecordVO;
|
|
||||||
import com.xunhong.erp.turbo.biz.app.assembler.DealerAccountRecordAssembler;
|
|
||||||
import com.xunhong.erp.turbo.biz.domain.entity.DealerAccountRecord;
|
|
||||||
import com.xunhong.erp.turbo.biz.domain.gateway.DealerAccountRecordGateway;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.springframework.stereotype.Component;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author shenyifei
|
|
||||||
*/
|
|
||||||
@Slf4j
|
|
||||||
@Component
|
|
||||||
@RequiredArgsConstructor
|
|
||||||
public class DealerAccountRecordCreateCmdExe {
|
|
||||||
|
|
||||||
private final DealerAccountRecordAssembler dealerAccountRecordAssembler;
|
|
||||||
private final DealerAccountRecordGateway dealerAccountRecordGateway;
|
|
||||||
|
|
||||||
public DealerAccountRecordVO execute(DealerAccountRecordCreateCmd dealerAccountRecordCreateCmd) {
|
|
||||||
DealerAccountRecord dealerAccountRecord = dealerAccountRecordGateway.save(dealerAccountRecordCreateCmd);
|
|
||||||
|
|
||||||
return dealerAccountRecordAssembler.toDealerAccountRecordVO(dealerAccountRecord);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@ -1,22 +0,0 @@
|
|||||||
package com.xunhong.erp.turbo.biz.app.executor.cmd;
|
|
||||||
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.cmd.DealerAccountRecordDestroyCmd;
|
|
||||||
import com.xunhong.erp.turbo.biz.domain.gateway.DealerAccountRecordGateway;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.springframework.stereotype.Component;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author shenyifei
|
|
||||||
*/
|
|
||||||
@Slf4j
|
|
||||||
@Component
|
|
||||||
@RequiredArgsConstructor
|
|
||||||
public class DealerAccountRecordDestroyCmdExe {
|
|
||||||
private final DealerAccountRecordGateway dealerAccountRecordGateway;
|
|
||||||
|
|
||||||
public void execute(DealerAccountRecordDestroyCmd dealerAccountRecordDestroyCmd) {
|
|
||||||
dealerAccountRecordGateway.destroy(dealerAccountRecordDestroyCmd);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@ -1,27 +0,0 @@
|
|||||||
package com.xunhong.erp.turbo.biz.app.executor.cmd;
|
|
||||||
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.cmd.DealerAccountRecordUpdateCmd;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.vo.DealerAccountRecordVO;
|
|
||||||
import com.xunhong.erp.turbo.biz.app.assembler.DealerAccountRecordAssembler;
|
|
||||||
import com.xunhong.erp.turbo.biz.domain.entity.DealerAccountRecord;
|
|
||||||
import com.xunhong.erp.turbo.biz.domain.gateway.DealerAccountRecordGateway;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.springframework.stereotype.Component;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author shenyifei
|
|
||||||
*/
|
|
||||||
@Slf4j
|
|
||||||
@Component
|
|
||||||
@RequiredArgsConstructor
|
|
||||||
public class DealerAccountRecordUpdateCmdExe {
|
|
||||||
|
|
||||||
private final DealerAccountRecordAssembler dealerAccountRecordAssembler;
|
|
||||||
private final DealerAccountRecordGateway dealerAccountRecordGateway;
|
|
||||||
|
|
||||||
public DealerAccountRecordVO execute(DealerAccountRecordUpdateCmd dealerAccountRecordUpdateCmd) {
|
|
||||||
DealerAccountRecord dealerAccountRecord = dealerAccountRecordGateway.update(dealerAccountRecordUpdateCmd);
|
|
||||||
return dealerAccountRecordAssembler.toDealerAccountRecordVO(dealerAccountRecord);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,6 +1,7 @@
|
|||||||
package com.xunhong.erp.turbo.biz.app.executor.cmd;
|
package com.xunhong.erp.turbo.biz.app.executor.cmd;
|
||||||
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.cmd.ProductDestroyCmd;
|
import com.xunhong.erp.turbo.api.biz.dto.cmd.ProductDestroyCmd;
|
||||||
|
import com.xunhong.erp.turbo.biz.app.assembler.ProductAssembler;
|
||||||
import com.xunhong.erp.turbo.biz.domain.gateway.ProductGateway;
|
import com.xunhong.erp.turbo.biz.domain.gateway.ProductGateway;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|||||||
@ -1,26 +0,0 @@
|
|||||||
package com.xunhong.erp.turbo.biz.app.executor.cmd;
|
|
||||||
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.cmd.ReconciliationCompleteCmd;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.vo.ReconciliationVO;
|
|
||||||
import com.xunhong.erp.turbo.biz.app.assembler.ReconciliationAssembler;
|
|
||||||
import com.xunhong.erp.turbo.biz.domain.entity.Reconciliation;
|
|
||||||
import com.xunhong.erp.turbo.biz.domain.gateway.ReconciliationGateway;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.springframework.stereotype.Component;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author shenyifei
|
|
||||||
*/
|
|
||||||
@Slf4j
|
|
||||||
@Component
|
|
||||||
@RequiredArgsConstructor
|
|
||||||
public class ReconciliationCompleteCmdExe {
|
|
||||||
private final ReconciliationGateway reconciliationGateway;
|
|
||||||
private final ReconciliationAssembler reconciliationAssembler;
|
|
||||||
|
|
||||||
public ReconciliationVO execute(ReconciliationCompleteCmd reconciliationCompleteCmd) {
|
|
||||||
Reconciliation reconciliation = reconciliationGateway.complete(reconciliationCompleteCmd);
|
|
||||||
return reconciliationAssembler.toReconciliationVO(reconciliation);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,29 +0,0 @@
|
|||||||
package com.xunhong.erp.turbo.biz.app.executor.cmd;
|
|
||||||
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.cmd.ReconciliationCreateCmd;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.vo.ReconciliationVO;
|
|
||||||
import com.xunhong.erp.turbo.biz.app.assembler.ReconciliationAssembler;
|
|
||||||
import com.xunhong.erp.turbo.biz.domain.entity.Reconciliation;
|
|
||||||
import com.xunhong.erp.turbo.biz.domain.gateway.ReconciliationGateway;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.springframework.stereotype.Component;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author shenyifei
|
|
||||||
*/
|
|
||||||
@Slf4j
|
|
||||||
@Component
|
|
||||||
@RequiredArgsConstructor
|
|
||||||
public class ReconciliationCreateCmdExe {
|
|
||||||
|
|
||||||
private final ReconciliationAssembler reconciliationAssembler;
|
|
||||||
private final ReconciliationGateway reconciliationGateway;
|
|
||||||
|
|
||||||
public ReconciliationVO execute(ReconciliationCreateCmd reconciliationCreateCmd) {
|
|
||||||
Reconciliation reconciliation = reconciliationGateway.save(reconciliationCreateCmd);
|
|
||||||
|
|
||||||
return reconciliationAssembler.toReconciliationVO(reconciliation);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@ -1,22 +0,0 @@
|
|||||||
package com.xunhong.erp.turbo.biz.app.executor.cmd;
|
|
||||||
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.cmd.ReconciliationDestroyCmd;
|
|
||||||
import com.xunhong.erp.turbo.biz.domain.gateway.ReconciliationGateway;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.springframework.stereotype.Component;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author shenyifei
|
|
||||||
*/
|
|
||||||
@Slf4j
|
|
||||||
@Component
|
|
||||||
@RequiredArgsConstructor
|
|
||||||
public class ReconciliationDestroyCmdExe {
|
|
||||||
private final ReconciliationGateway reconciliationGateway;
|
|
||||||
|
|
||||||
public void execute(ReconciliationDestroyCmd reconciliationDestroyCmd) {
|
|
||||||
reconciliationGateway.destroy(reconciliationDestroyCmd);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@ -1,29 +0,0 @@
|
|||||||
package com.xunhong.erp.turbo.biz.app.executor.cmd;
|
|
||||||
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.cmd.ReconciliationInvoiceCreateCmd;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.vo.ReconciliationInvoiceVO;
|
|
||||||
import com.xunhong.erp.turbo.biz.app.assembler.ReconciliationInvoiceAssembler;
|
|
||||||
import com.xunhong.erp.turbo.biz.domain.entity.ReconciliationInvoice;
|
|
||||||
import com.xunhong.erp.turbo.biz.domain.gateway.ReconciliationInvoiceGateway;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.springframework.stereotype.Component;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author shenyifei
|
|
||||||
*/
|
|
||||||
@Slf4j
|
|
||||||
@Component
|
|
||||||
@RequiredArgsConstructor
|
|
||||||
public class ReconciliationInvoiceCreateCmdExe {
|
|
||||||
|
|
||||||
private final ReconciliationInvoiceAssembler reconciliationInvoiceAssembler;
|
|
||||||
private final ReconciliationInvoiceGateway reconciliationInvoiceGateway;
|
|
||||||
|
|
||||||
public ReconciliationInvoiceVO execute(ReconciliationInvoiceCreateCmd reconciliationInvoiceCreateCmd) {
|
|
||||||
ReconciliationInvoice reconciliationInvoice = reconciliationInvoiceGateway.save(reconciliationInvoiceCreateCmd);
|
|
||||||
|
|
||||||
return reconciliationInvoiceAssembler.toReconciliationInvoiceVO(reconciliationInvoice);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@ -1,22 +0,0 @@
|
|||||||
package com.xunhong.erp.turbo.biz.app.executor.cmd;
|
|
||||||
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.cmd.ReconciliationInvoiceDestroyCmd;
|
|
||||||
import com.xunhong.erp.turbo.biz.domain.gateway.ReconciliationInvoiceGateway;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.springframework.stereotype.Component;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author shenyifei
|
|
||||||
*/
|
|
||||||
@Slf4j
|
|
||||||
@Component
|
|
||||||
@RequiredArgsConstructor
|
|
||||||
public class ReconciliationInvoiceDestroyCmdExe {
|
|
||||||
private final ReconciliationInvoiceGateway reconciliationInvoiceGateway;
|
|
||||||
|
|
||||||
public void execute(ReconciliationInvoiceDestroyCmd reconciliationInvoiceDestroyCmd) {
|
|
||||||
reconciliationInvoiceGateway.destroy(reconciliationInvoiceDestroyCmd);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@ -1,27 +0,0 @@
|
|||||||
package com.xunhong.erp.turbo.biz.app.executor.cmd;
|
|
||||||
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.cmd.ReconciliationInvoiceUpdateCmd;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.vo.ReconciliationInvoiceVO;
|
|
||||||
import com.xunhong.erp.turbo.biz.app.assembler.ReconciliationInvoiceAssembler;
|
|
||||||
import com.xunhong.erp.turbo.biz.domain.entity.ReconciliationInvoice;
|
|
||||||
import com.xunhong.erp.turbo.biz.domain.gateway.ReconciliationInvoiceGateway;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.springframework.stereotype.Component;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author shenyifei
|
|
||||||
*/
|
|
||||||
@Slf4j
|
|
||||||
@Component
|
|
||||||
@RequiredArgsConstructor
|
|
||||||
public class ReconciliationInvoiceUpdateCmdExe {
|
|
||||||
|
|
||||||
private final ReconciliationInvoiceAssembler reconciliationInvoiceAssembler;
|
|
||||||
private final ReconciliationInvoiceGateway reconciliationInvoiceGateway;
|
|
||||||
|
|
||||||
public ReconciliationInvoiceVO execute(ReconciliationInvoiceUpdateCmd reconciliationInvoiceUpdateCmd) {
|
|
||||||
ReconciliationInvoice reconciliationInvoice = reconciliationInvoiceGateway.update(reconciliationInvoiceUpdateCmd);
|
|
||||||
return reconciliationInvoiceAssembler.toReconciliationInvoiceVO(reconciliationInvoice);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,29 +0,0 @@
|
|||||||
package com.xunhong.erp.turbo.biz.app.executor.cmd;
|
|
||||||
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.cmd.ReconciliationPaymentCreateCmd;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.vo.ReconciliationPaymentVO;
|
|
||||||
import com.xunhong.erp.turbo.biz.app.assembler.ReconciliationPaymentAssembler;
|
|
||||||
import com.xunhong.erp.turbo.biz.domain.entity.ReconciliationPayment;
|
|
||||||
import com.xunhong.erp.turbo.biz.domain.gateway.ReconciliationPaymentGateway;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.springframework.stereotype.Component;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author shenyifei
|
|
||||||
*/
|
|
||||||
@Slf4j
|
|
||||||
@Component
|
|
||||||
@RequiredArgsConstructor
|
|
||||||
public class ReconciliationPaymentCreateCmdExe {
|
|
||||||
|
|
||||||
private final ReconciliationPaymentAssembler reconciliationPaymentAssembler;
|
|
||||||
private final ReconciliationPaymentGateway reconciliationPaymentGateway;
|
|
||||||
|
|
||||||
public ReconciliationPaymentVO execute(ReconciliationPaymentCreateCmd reconciliationPaymentCreateCmd) {
|
|
||||||
ReconciliationPayment reconciliationPayment = reconciliationPaymentGateway.save(reconciliationPaymentCreateCmd);
|
|
||||||
|
|
||||||
return reconciliationPaymentAssembler.toReconciliationPaymentVO(reconciliationPayment);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@ -1,22 +0,0 @@
|
|||||||
package com.xunhong.erp.turbo.biz.app.executor.cmd;
|
|
||||||
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.cmd.ReconciliationPaymentDestroyCmd;
|
|
||||||
import com.xunhong.erp.turbo.biz.domain.gateway.ReconciliationPaymentGateway;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.springframework.stereotype.Component;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author shenyifei
|
|
||||||
*/
|
|
||||||
@Slf4j
|
|
||||||
@Component
|
|
||||||
@RequiredArgsConstructor
|
|
||||||
public class ReconciliationPaymentDestroyCmdExe {
|
|
||||||
private final ReconciliationPaymentGateway reconciliationPaymentGateway;
|
|
||||||
|
|
||||||
public void execute(ReconciliationPaymentDestroyCmd reconciliationPaymentDestroyCmd) {
|
|
||||||
reconciliationPaymentGateway.destroy(reconciliationPaymentDestroyCmd);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@ -1,27 +0,0 @@
|
|||||||
package com.xunhong.erp.turbo.biz.app.executor.cmd;
|
|
||||||
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.cmd.ReconciliationPaymentUpdateCmd;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.vo.ReconciliationPaymentVO;
|
|
||||||
import com.xunhong.erp.turbo.biz.app.assembler.ReconciliationPaymentAssembler;
|
|
||||||
import com.xunhong.erp.turbo.biz.domain.entity.ReconciliationPayment;
|
|
||||||
import com.xunhong.erp.turbo.biz.domain.gateway.ReconciliationPaymentGateway;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.springframework.stereotype.Component;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author shenyifei
|
|
||||||
*/
|
|
||||||
@Slf4j
|
|
||||||
@Component
|
|
||||||
@RequiredArgsConstructor
|
|
||||||
public class ReconciliationPaymentUpdateCmdExe {
|
|
||||||
|
|
||||||
private final ReconciliationPaymentAssembler reconciliationPaymentAssembler;
|
|
||||||
private final ReconciliationPaymentGateway reconciliationPaymentGateway;
|
|
||||||
|
|
||||||
public ReconciliationPaymentVO execute(ReconciliationPaymentUpdateCmd reconciliationPaymentUpdateCmd) {
|
|
||||||
ReconciliationPayment reconciliationPayment = reconciliationPaymentGateway.update(reconciliationPaymentUpdateCmd);
|
|
||||||
return reconciliationPaymentAssembler.toReconciliationPaymentVO(reconciliationPayment);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,27 +0,0 @@
|
|||||||
package com.xunhong.erp.turbo.biz.app.executor.cmd;
|
|
||||||
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.cmd.ReconciliationUpdateCmd;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.vo.ReconciliationVO;
|
|
||||||
import com.xunhong.erp.turbo.biz.app.assembler.ReconciliationAssembler;
|
|
||||||
import com.xunhong.erp.turbo.biz.domain.entity.Reconciliation;
|
|
||||||
import com.xunhong.erp.turbo.biz.domain.gateway.ReconciliationGateway;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.springframework.stereotype.Component;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author shenyifei
|
|
||||||
*/
|
|
||||||
@Slf4j
|
|
||||||
@Component
|
|
||||||
@RequiredArgsConstructor
|
|
||||||
public class ReconciliationUpdateCmdExe {
|
|
||||||
|
|
||||||
private final ReconciliationAssembler reconciliationAssembler;
|
|
||||||
private final ReconciliationGateway reconciliationGateway;
|
|
||||||
|
|
||||||
public ReconciliationVO execute(ReconciliationUpdateCmd reconciliationUpdateCmd) {
|
|
||||||
Reconciliation reconciliation = reconciliationGateway.update(reconciliationUpdateCmd);
|
|
||||||
return reconciliationAssembler.toReconciliationVO(reconciliation);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,30 +0,0 @@
|
|||||||
package com.xunhong.erp.turbo.biz.app.executor.query;
|
|
||||||
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.qry.DealerAccountRecordListQry;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.vo.DealerAccountRecordVO;
|
|
||||||
import com.xunhong.erp.turbo.biz.app.assembler.DealerAccountRecordAssembler;
|
|
||||||
import com.xunhong.erp.turbo.biz.domain.entity.DealerAccountRecord;
|
|
||||||
import com.xunhong.erp.turbo.biz.domain.gateway.DealerAccountRecordGateway;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.springframework.stereotype.Component;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author shenyifei
|
|
||||||
*/
|
|
||||||
@Slf4j
|
|
||||||
@Component
|
|
||||||
@RequiredArgsConstructor
|
|
||||||
public class DealerAccountRecordListQryExe {
|
|
||||||
|
|
||||||
private final DealerAccountRecordGateway dealerAccountRecordGateway;
|
|
||||||
private final DealerAccountRecordAssembler dealerAccountRecordAssembler;
|
|
||||||
|
|
||||||
public List<DealerAccountRecordVO> execute(DealerAccountRecordListQry dealerAccountRecordListQry) {
|
|
||||||
List<DealerAccountRecord> dealerAccountRecordList = dealerAccountRecordGateway.list(dealerAccountRecordListQry);
|
|
||||||
return dealerAccountRecordList.stream().map(dealerAccountRecordAssembler::toDealerAccountRecordVO).toList();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@ -1,29 +0,0 @@
|
|||||||
package com.xunhong.erp.turbo.biz.app.executor.query;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.qry.DealerAccountRecordPageQry;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.vo.DealerAccountRecordVO;
|
|
||||||
import com.xunhong.erp.turbo.biz.app.assembler.DealerAccountRecordAssembler;
|
|
||||||
import com.xunhong.erp.turbo.biz.domain.entity.DealerAccountRecord;
|
|
||||||
import com.xunhong.erp.turbo.biz.domain.gateway.DealerAccountRecordGateway;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.springframework.stereotype.Component;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author shenyifei
|
|
||||||
*/
|
|
||||||
@Slf4j
|
|
||||||
@Component
|
|
||||||
@RequiredArgsConstructor
|
|
||||||
public class DealerAccountRecordPageQryExe {
|
|
||||||
|
|
||||||
private final DealerAccountRecordGateway dealerAccountRecordGateway;
|
|
||||||
private final DealerAccountRecordAssembler dealerAccountRecordAssembler;
|
|
||||||
|
|
||||||
public IPage<DealerAccountRecordVO> execute(DealerAccountRecordPageQry dealerAccountRecordPageQry) {
|
|
||||||
IPage<DealerAccountRecord> page = dealerAccountRecordGateway.page(dealerAccountRecordPageQry);
|
|
||||||
return page.convert(dealerAccountRecordAssembler::toDealerAccountRecordVO);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@ -1,29 +0,0 @@
|
|||||||
package com.xunhong.erp.turbo.biz.app.executor.query;
|
|
||||||
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.qry.DealerAccountRecordShowQry;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.vo.DealerAccountRecordVO;
|
|
||||||
import com.xunhong.erp.turbo.biz.app.assembler.DealerAccountRecordAssembler;
|
|
||||||
import com.xunhong.erp.turbo.biz.domain.entity.DealerAccountRecord;
|
|
||||||
import com.xunhong.erp.turbo.biz.domain.gateway.DealerAccountRecordGateway;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.springframework.stereotype.Component;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author shenyifei
|
|
||||||
*/
|
|
||||||
@Slf4j
|
|
||||||
@Component
|
|
||||||
@RequiredArgsConstructor
|
|
||||||
public class DealerAccountRecordShowQryExe {
|
|
||||||
|
|
||||||
private final DealerAccountRecordAssembler dealerAccountRecordAssembler;
|
|
||||||
private final DealerAccountRecordGateway dealerAccountRecordGateway;
|
|
||||||
|
|
||||||
public DealerAccountRecordVO execute(DealerAccountRecordShowQry dealerAccountRecordShowQry) {
|
|
||||||
DealerAccountRecord dealerAccountRecord = dealerAccountRecordGateway.show(dealerAccountRecordShowQry);
|
|
||||||
|
|
||||||
return dealerAccountRecordAssembler.toDealerAccountRecordVO(dealerAccountRecord);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@ -1,30 +0,0 @@
|
|||||||
package com.xunhong.erp.turbo.biz.app.executor.query;
|
|
||||||
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.qry.ReconciliationInvoiceListQry;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.vo.ReconciliationInvoiceVO;
|
|
||||||
import com.xunhong.erp.turbo.biz.app.assembler.ReconciliationInvoiceAssembler;
|
|
||||||
import com.xunhong.erp.turbo.biz.domain.entity.ReconciliationInvoice;
|
|
||||||
import com.xunhong.erp.turbo.biz.domain.gateway.ReconciliationInvoiceGateway;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.springframework.stereotype.Component;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author shenyifei
|
|
||||||
*/
|
|
||||||
@Slf4j
|
|
||||||
@Component
|
|
||||||
@RequiredArgsConstructor
|
|
||||||
public class ReconciliationInvoiceListQryExe {
|
|
||||||
|
|
||||||
private final ReconciliationInvoiceGateway reconciliationInvoiceGateway;
|
|
||||||
private final ReconciliationInvoiceAssembler reconciliationInvoiceAssembler;
|
|
||||||
|
|
||||||
public List<ReconciliationInvoiceVO> execute(ReconciliationInvoiceListQry reconciliationInvoiceListQry) {
|
|
||||||
List<ReconciliationInvoice> reconciliationInvoiceList = reconciliationInvoiceGateway.list(reconciliationInvoiceListQry);
|
|
||||||
return reconciliationInvoiceList.stream().map(reconciliationInvoiceAssembler::toReconciliationInvoiceVO).toList();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@ -1,29 +0,0 @@
|
|||||||
package com.xunhong.erp.turbo.biz.app.executor.query;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.qry.ReconciliationInvoicePageQry;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.vo.ReconciliationInvoiceVO;
|
|
||||||
import com.xunhong.erp.turbo.biz.app.assembler.ReconciliationInvoiceAssembler;
|
|
||||||
import com.xunhong.erp.turbo.biz.domain.entity.ReconciliationInvoice;
|
|
||||||
import com.xunhong.erp.turbo.biz.domain.gateway.ReconciliationInvoiceGateway;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.springframework.stereotype.Component;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author shenyifei
|
|
||||||
*/
|
|
||||||
@Slf4j
|
|
||||||
@Component
|
|
||||||
@RequiredArgsConstructor
|
|
||||||
public class ReconciliationInvoicePageQryExe {
|
|
||||||
|
|
||||||
private final ReconciliationInvoiceGateway reconciliationInvoiceGateway;
|
|
||||||
private final ReconciliationInvoiceAssembler reconciliationInvoiceAssembler;
|
|
||||||
|
|
||||||
public IPage<ReconciliationInvoiceVO> execute(ReconciliationInvoicePageQry reconciliationInvoicePageQry) {
|
|
||||||
IPage<ReconciliationInvoice> page = reconciliationInvoiceGateway.page(reconciliationInvoicePageQry);
|
|
||||||
return page.convert(reconciliationInvoiceAssembler::toReconciliationInvoiceVO);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@ -1,29 +0,0 @@
|
|||||||
package com.xunhong.erp.turbo.biz.app.executor.query;
|
|
||||||
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.qry.ReconciliationInvoiceShowQry;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.vo.ReconciliationInvoiceVO;
|
|
||||||
import com.xunhong.erp.turbo.biz.app.assembler.ReconciliationInvoiceAssembler;
|
|
||||||
import com.xunhong.erp.turbo.biz.domain.entity.ReconciliationInvoice;
|
|
||||||
import com.xunhong.erp.turbo.biz.domain.gateway.ReconciliationInvoiceGateway;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.springframework.stereotype.Component;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author shenyifei
|
|
||||||
*/
|
|
||||||
@Slf4j
|
|
||||||
@Component
|
|
||||||
@RequiredArgsConstructor
|
|
||||||
public class ReconciliationInvoiceShowQryExe {
|
|
||||||
|
|
||||||
private final ReconciliationInvoiceAssembler reconciliationInvoiceAssembler;
|
|
||||||
private final ReconciliationInvoiceGateway reconciliationInvoiceGateway;
|
|
||||||
|
|
||||||
public ReconciliationInvoiceVO execute(ReconciliationInvoiceShowQry reconciliationInvoiceShowQry) {
|
|
||||||
ReconciliationInvoice reconciliationInvoice = reconciliationInvoiceGateway.show(reconciliationInvoiceShowQry);
|
|
||||||
|
|
||||||
return reconciliationInvoiceAssembler.toReconciliationInvoiceVO(reconciliationInvoice);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@ -1,30 +0,0 @@
|
|||||||
package com.xunhong.erp.turbo.biz.app.executor.query;
|
|
||||||
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.qry.ReconciliationListQry;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.vo.ReconciliationVO;
|
|
||||||
import com.xunhong.erp.turbo.biz.app.assembler.ReconciliationAssembler;
|
|
||||||
import com.xunhong.erp.turbo.biz.domain.entity.Reconciliation;
|
|
||||||
import com.xunhong.erp.turbo.biz.domain.gateway.ReconciliationGateway;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.springframework.stereotype.Component;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author shenyifei
|
|
||||||
*/
|
|
||||||
@Slf4j
|
|
||||||
@Component
|
|
||||||
@RequiredArgsConstructor
|
|
||||||
public class ReconciliationListQryExe {
|
|
||||||
|
|
||||||
private final ReconciliationGateway reconciliationGateway;
|
|
||||||
private final ReconciliationAssembler reconciliationAssembler;
|
|
||||||
|
|
||||||
public List<ReconciliationVO> execute(ReconciliationListQry reconciliationListQry) {
|
|
||||||
List<Reconciliation> reconciliationList = reconciliationGateway.list(reconciliationListQry);
|
|
||||||
return reconciliationList.stream().map(reconciliationAssembler::toReconciliationVO).toList();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@ -1,29 +0,0 @@
|
|||||||
package com.xunhong.erp.turbo.biz.app.executor.query;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.qry.ReconciliationPageQry;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.vo.ReconciliationVO;
|
|
||||||
import com.xunhong.erp.turbo.biz.app.assembler.ReconciliationAssembler;
|
|
||||||
import com.xunhong.erp.turbo.biz.domain.entity.Reconciliation;
|
|
||||||
import com.xunhong.erp.turbo.biz.domain.gateway.ReconciliationGateway;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.springframework.stereotype.Component;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author shenyifei
|
|
||||||
*/
|
|
||||||
@Slf4j
|
|
||||||
@Component
|
|
||||||
@RequiredArgsConstructor
|
|
||||||
public class ReconciliationPageQryExe {
|
|
||||||
|
|
||||||
private final ReconciliationGateway reconciliationGateway;
|
|
||||||
private final ReconciliationAssembler reconciliationAssembler;
|
|
||||||
|
|
||||||
public IPage<ReconciliationVO> execute(ReconciliationPageQry reconciliationPageQry) {
|
|
||||||
IPage<Reconciliation> page = reconciliationGateway.page(reconciliationPageQry);
|
|
||||||
return page.convert(reconciliationAssembler::toReconciliationVO);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@ -1,30 +0,0 @@
|
|||||||
package com.xunhong.erp.turbo.biz.app.executor.query;
|
|
||||||
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.qry.ReconciliationPaymentListQry;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.vo.ReconciliationPaymentVO;
|
|
||||||
import com.xunhong.erp.turbo.biz.app.assembler.ReconciliationPaymentAssembler;
|
|
||||||
import com.xunhong.erp.turbo.biz.domain.entity.ReconciliationPayment;
|
|
||||||
import com.xunhong.erp.turbo.biz.domain.gateway.ReconciliationPaymentGateway;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.springframework.stereotype.Component;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author shenyifei
|
|
||||||
*/
|
|
||||||
@Slf4j
|
|
||||||
@Component
|
|
||||||
@RequiredArgsConstructor
|
|
||||||
public class ReconciliationPaymentListQryExe {
|
|
||||||
|
|
||||||
private final ReconciliationPaymentGateway reconciliationPaymentGateway;
|
|
||||||
private final ReconciliationPaymentAssembler reconciliationPaymentAssembler;
|
|
||||||
|
|
||||||
public List<ReconciliationPaymentVO> execute(ReconciliationPaymentListQry reconciliationPaymentListQry) {
|
|
||||||
List<ReconciliationPayment> reconciliationPaymentList = reconciliationPaymentGateway.list(reconciliationPaymentListQry);
|
|
||||||
return reconciliationPaymentList.stream().map(reconciliationPaymentAssembler::toReconciliationPaymentVO).toList();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@ -1,29 +0,0 @@
|
|||||||
package com.xunhong.erp.turbo.biz.app.executor.query;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.qry.ReconciliationPaymentPageQry;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.vo.ReconciliationPaymentVO;
|
|
||||||
import com.xunhong.erp.turbo.biz.app.assembler.ReconciliationPaymentAssembler;
|
|
||||||
import com.xunhong.erp.turbo.biz.domain.entity.ReconciliationPayment;
|
|
||||||
import com.xunhong.erp.turbo.biz.domain.gateway.ReconciliationPaymentGateway;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.springframework.stereotype.Component;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author shenyifei
|
|
||||||
*/
|
|
||||||
@Slf4j
|
|
||||||
@Component
|
|
||||||
@RequiredArgsConstructor
|
|
||||||
public class ReconciliationPaymentPageQryExe {
|
|
||||||
|
|
||||||
private final ReconciliationPaymentGateway reconciliationPaymentGateway;
|
|
||||||
private final ReconciliationPaymentAssembler reconciliationPaymentAssembler;
|
|
||||||
|
|
||||||
public IPage<ReconciliationPaymentVO> execute(ReconciliationPaymentPageQry reconciliationPaymentPageQry) {
|
|
||||||
IPage<ReconciliationPayment> page = reconciliationPaymentGateway.page(reconciliationPaymentPageQry);
|
|
||||||
return page.convert(reconciliationPaymentAssembler::toReconciliationPaymentVO);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@ -1,29 +0,0 @@
|
|||||||
package com.xunhong.erp.turbo.biz.app.executor.query;
|
|
||||||
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.qry.ReconciliationPaymentShowQry;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.vo.ReconciliationPaymentVO;
|
|
||||||
import com.xunhong.erp.turbo.biz.app.assembler.ReconciliationPaymentAssembler;
|
|
||||||
import com.xunhong.erp.turbo.biz.domain.entity.ReconciliationPayment;
|
|
||||||
import com.xunhong.erp.turbo.biz.domain.gateway.ReconciliationPaymentGateway;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.springframework.stereotype.Component;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author shenyifei
|
|
||||||
*/
|
|
||||||
@Slf4j
|
|
||||||
@Component
|
|
||||||
@RequiredArgsConstructor
|
|
||||||
public class ReconciliationPaymentShowQryExe {
|
|
||||||
|
|
||||||
private final ReconciliationPaymentAssembler reconciliationPaymentAssembler;
|
|
||||||
private final ReconciliationPaymentGateway reconciliationPaymentGateway;
|
|
||||||
|
|
||||||
public ReconciliationPaymentVO execute(ReconciliationPaymentShowQry reconciliationPaymentShowQry) {
|
|
||||||
ReconciliationPayment reconciliationPayment = reconciliationPaymentGateway.show(reconciliationPaymentShowQry);
|
|
||||||
|
|
||||||
return reconciliationPaymentAssembler.toReconciliationPaymentVO(reconciliationPayment);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@ -1,29 +0,0 @@
|
|||||||
package com.xunhong.erp.turbo.biz.app.executor.query;
|
|
||||||
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.qry.ReconciliationShowQry;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.vo.ReconciliationVO;
|
|
||||||
import com.xunhong.erp.turbo.biz.app.assembler.ReconciliationAssembler;
|
|
||||||
import com.xunhong.erp.turbo.biz.domain.entity.Reconciliation;
|
|
||||||
import com.xunhong.erp.turbo.biz.domain.gateway.ReconciliationGateway;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.springframework.stereotype.Component;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author shenyifei
|
|
||||||
*/
|
|
||||||
@Slf4j
|
|
||||||
@Component
|
|
||||||
@RequiredArgsConstructor
|
|
||||||
public class ReconciliationShowQryExe {
|
|
||||||
|
|
||||||
private final ReconciliationAssembler reconciliationAssembler;
|
|
||||||
private final ReconciliationGateway reconciliationGateway;
|
|
||||||
|
|
||||||
public ReconciliationVO execute(ReconciliationShowQry reconciliationShowQry) {
|
|
||||||
Reconciliation reconciliation = reconciliationGateway.show(reconciliationShowQry);
|
|
||||||
|
|
||||||
return reconciliationAssembler.toReconciliationVO(reconciliation);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@ -1,71 +0,0 @@
|
|||||||
package com.xunhong.erp.turbo.biz.app.service;
|
|
||||||
|
|
||||||
import com.xunhong.erp.turbo.api.biz.api.DealerAccountRecordServiceI;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.cmd.DealerAccountRecordCreateCmd;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.cmd.DealerAccountRecordDestroyCmd;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.cmd.DealerAccountRecordUpdateCmd;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.qry.DealerAccountRecordListQry;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.qry.DealerAccountRecordPageQry;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.qry.DealerAccountRecordShowQry;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.vo.DealerAccountRecordVO;
|
|
||||||
import com.xunhong.erp.turbo.base.dto.PageDTO;
|
|
||||||
import com.xunhong.erp.turbo.biz.app.executor.cmd.DealerAccountRecordCreateCmdExe;
|
|
||||||
import com.xunhong.erp.turbo.biz.app.executor.cmd.DealerAccountRecordDestroyCmdExe;
|
|
||||||
import com.xunhong.erp.turbo.biz.app.executor.cmd.DealerAccountRecordUpdateCmdExe;
|
|
||||||
import com.xunhong.erp.turbo.biz.app.executor.query.DealerAccountRecordListQryExe;
|
|
||||||
import com.xunhong.erp.turbo.biz.app.executor.query.DealerAccountRecordPageQryExe;
|
|
||||||
import com.xunhong.erp.turbo.biz.app.executor.query.DealerAccountRecordShowQryExe;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.apache.dubbo.config.annotation.DubboService;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author shenyifei
|
|
||||||
*/
|
|
||||||
@Slf4j
|
|
||||||
@Service
|
|
||||||
@DubboService(interfaceClass = DealerAccountRecordServiceI.class, version = "1.0.0")
|
|
||||||
@RequiredArgsConstructor
|
|
||||||
public class DealerAccountRecordServiceImpl implements DealerAccountRecordServiceI {
|
|
||||||
|
|
||||||
private final DealerAccountRecordCreateCmdExe dealerAccountRecordCreateCmdExe;
|
|
||||||
private final DealerAccountRecordUpdateCmdExe dealerAccountRecordUpdateCmdExe;
|
|
||||||
private final DealerAccountRecordPageQryExe dealerAccountRecordPageQryExe;
|
|
||||||
private final DealerAccountRecordListQryExe dealerAccountRecordListQryExe;
|
|
||||||
private final DealerAccountRecordShowQryExe dealerAccountRecordShowQryExe;
|
|
||||||
private final DealerAccountRecordDestroyCmdExe dealerAccountRecordDestroyCmdExe;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public DealerAccountRecordVO create(DealerAccountRecordCreateCmd dealerAccountRecordCreateCmd) {
|
|
||||||
return dealerAccountRecordCreateCmdExe.execute(dealerAccountRecordCreateCmd);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public PageDTO<DealerAccountRecordVO> page(DealerAccountRecordPageQry dealerAccountRecordPageQry) {
|
|
||||||
return PageDTO.of(dealerAccountRecordPageQryExe.execute(dealerAccountRecordPageQry));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<DealerAccountRecordVO> list(DealerAccountRecordListQry dealerAccountRecordListQry) {
|
|
||||||
return dealerAccountRecordListQryExe.execute(dealerAccountRecordListQry);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public DealerAccountRecordVO update(DealerAccountRecordUpdateCmd dealerAccountRecordUpdateCmd) {
|
|
||||||
return dealerAccountRecordUpdateCmdExe.execute(dealerAccountRecordUpdateCmd);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public DealerAccountRecordVO show(DealerAccountRecordShowQry dealerAccountRecordShowQry) {
|
|
||||||
return dealerAccountRecordShowQryExe.execute(dealerAccountRecordShowQry);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void destroy(DealerAccountRecordDestroyCmd dealerAccountRecordDestroyCmd) {
|
|
||||||
dealerAccountRecordDestroyCmdExe.execute(dealerAccountRecordDestroyCmd);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@ -3,8 +3,8 @@ package com.xunhong.erp.turbo.biz.app.service;
|
|||||||
import com.xunhong.erp.turbo.api.biz.api.ProductServiceI;
|
import com.xunhong.erp.turbo.api.biz.api.ProductServiceI;
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.cmd.ProductCreateCmd;
|
import com.xunhong.erp.turbo.api.biz.dto.cmd.ProductCreateCmd;
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.cmd.ProductDestroyCmd;
|
import com.xunhong.erp.turbo.api.biz.dto.cmd.ProductDestroyCmd;
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.cmd.ProductDragCmd;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.cmd.ProductUpdateCmd;
|
import com.xunhong.erp.turbo.api.biz.dto.cmd.ProductUpdateCmd;
|
||||||
|
import com.xunhong.erp.turbo.api.biz.dto.cmd.ProductDragCmd;
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.qry.ProductListQry;
|
import com.xunhong.erp.turbo.api.biz.dto.qry.ProductListQry;
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.qry.ProductPageQry;
|
import com.xunhong.erp.turbo.api.biz.dto.qry.ProductPageQry;
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.qry.ProductShowQry;
|
import com.xunhong.erp.turbo.api.biz.dto.qry.ProductShowQry;
|
||||||
@ -13,10 +13,10 @@ import com.xunhong.erp.turbo.base.dto.PageDTO;
|
|||||||
import com.xunhong.erp.turbo.biz.app.executor.cmd.ProductCreateCmdExe;
|
import com.xunhong.erp.turbo.biz.app.executor.cmd.ProductCreateCmdExe;
|
||||||
import com.xunhong.erp.turbo.biz.app.executor.cmd.ProductDestroyCmdExe;
|
import com.xunhong.erp.turbo.biz.app.executor.cmd.ProductDestroyCmdExe;
|
||||||
import com.xunhong.erp.turbo.biz.app.executor.cmd.ProductUpdateCmdExe;
|
import com.xunhong.erp.turbo.biz.app.executor.cmd.ProductUpdateCmdExe;
|
||||||
import com.xunhong.erp.turbo.biz.app.executor.query.ProductDragCmdExe;
|
|
||||||
import com.xunhong.erp.turbo.biz.app.executor.query.ProductListQryExe;
|
import com.xunhong.erp.turbo.biz.app.executor.query.ProductListQryExe;
|
||||||
import com.xunhong.erp.turbo.biz.app.executor.query.ProductPageQryExe;
|
import com.xunhong.erp.turbo.biz.app.executor.query.ProductPageQryExe;
|
||||||
import com.xunhong.erp.turbo.biz.app.executor.query.ProductShowQryExe;
|
import com.xunhong.erp.turbo.biz.app.executor.query.ProductShowQryExe;
|
||||||
|
import com.xunhong.erp.turbo.biz.app.executor.query.ProductDragCmdExe;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.dubbo.config.annotation.DubboService;
|
import org.apache.dubbo.config.annotation.DubboService;
|
||||||
|
|||||||
@ -1,71 +0,0 @@
|
|||||||
package com.xunhong.erp.turbo.biz.app.service;
|
|
||||||
|
|
||||||
import com.xunhong.erp.turbo.api.biz.api.ReconciliationInvoiceServiceI;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.cmd.ReconciliationInvoiceCreateCmd;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.cmd.ReconciliationInvoiceDestroyCmd;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.cmd.ReconciliationInvoiceUpdateCmd;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.qry.ReconciliationInvoiceListQry;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.qry.ReconciliationInvoicePageQry;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.qry.ReconciliationInvoiceShowQry;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.vo.ReconciliationInvoiceVO;
|
|
||||||
import com.xunhong.erp.turbo.base.dto.PageDTO;
|
|
||||||
import com.xunhong.erp.turbo.biz.app.executor.cmd.ReconciliationInvoiceCreateCmdExe;
|
|
||||||
import com.xunhong.erp.turbo.biz.app.executor.cmd.ReconciliationInvoiceDestroyCmdExe;
|
|
||||||
import com.xunhong.erp.turbo.biz.app.executor.cmd.ReconciliationInvoiceUpdateCmdExe;
|
|
||||||
import com.xunhong.erp.turbo.biz.app.executor.query.ReconciliationInvoiceListQryExe;
|
|
||||||
import com.xunhong.erp.turbo.biz.app.executor.query.ReconciliationInvoicePageQryExe;
|
|
||||||
import com.xunhong.erp.turbo.biz.app.executor.query.ReconciliationInvoiceShowQryExe;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.apache.dubbo.config.annotation.DubboService;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author shenyifei
|
|
||||||
*/
|
|
||||||
@Slf4j
|
|
||||||
@Service
|
|
||||||
@DubboService(interfaceClass = ReconciliationInvoiceServiceI.class, version = "1.0.0")
|
|
||||||
@RequiredArgsConstructor
|
|
||||||
public class ReconciliationInvoiceServiceImpl implements ReconciliationInvoiceServiceI {
|
|
||||||
|
|
||||||
private final ReconciliationInvoiceCreateCmdExe reconciliationInvoiceCreateCmdExe;
|
|
||||||
private final ReconciliationInvoiceUpdateCmdExe reconciliationInvoiceUpdateCmdExe;
|
|
||||||
private final ReconciliationInvoicePageQryExe reconciliationInvoicePageQryExe;
|
|
||||||
private final ReconciliationInvoiceListQryExe reconciliationInvoiceListQryExe;
|
|
||||||
private final ReconciliationInvoiceShowQryExe reconciliationInvoiceShowQryExe;
|
|
||||||
private final ReconciliationInvoiceDestroyCmdExe reconciliationInvoiceDestroyCmdExe;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public ReconciliationInvoiceVO create(ReconciliationInvoiceCreateCmd reconciliationInvoiceCreateCmd) {
|
|
||||||
return reconciliationInvoiceCreateCmdExe.execute(reconciliationInvoiceCreateCmd);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public PageDTO<ReconciliationInvoiceVO> page(ReconciliationInvoicePageQry reconciliationInvoicePageQry) {
|
|
||||||
return PageDTO.of(reconciliationInvoicePageQryExe.execute(reconciliationInvoicePageQry));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<ReconciliationInvoiceVO> list(ReconciliationInvoiceListQry reconciliationInvoiceListQry) {
|
|
||||||
return reconciliationInvoiceListQryExe.execute(reconciliationInvoiceListQry);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public ReconciliationInvoiceVO update(ReconciliationInvoiceUpdateCmd reconciliationInvoiceUpdateCmd) {
|
|
||||||
return reconciliationInvoiceUpdateCmdExe.execute(reconciliationInvoiceUpdateCmd);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public ReconciliationInvoiceVO show(ReconciliationInvoiceShowQry reconciliationInvoiceShowQry) {
|
|
||||||
return reconciliationInvoiceShowQryExe.execute(reconciliationInvoiceShowQry);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void destroy(ReconciliationInvoiceDestroyCmd reconciliationInvoiceDestroyCmd) {
|
|
||||||
reconciliationInvoiceDestroyCmdExe.execute(reconciliationInvoiceDestroyCmd);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@ -1,71 +0,0 @@
|
|||||||
package com.xunhong.erp.turbo.biz.app.service;
|
|
||||||
|
|
||||||
import com.xunhong.erp.turbo.api.biz.api.ReconciliationPaymentServiceI;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.cmd.ReconciliationPaymentCreateCmd;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.cmd.ReconciliationPaymentDestroyCmd;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.cmd.ReconciliationPaymentUpdateCmd;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.qry.ReconciliationPaymentListQry;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.qry.ReconciliationPaymentPageQry;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.qry.ReconciliationPaymentShowQry;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.vo.ReconciliationPaymentVO;
|
|
||||||
import com.xunhong.erp.turbo.base.dto.PageDTO;
|
|
||||||
import com.xunhong.erp.turbo.biz.app.executor.cmd.ReconciliationPaymentCreateCmdExe;
|
|
||||||
import com.xunhong.erp.turbo.biz.app.executor.cmd.ReconciliationPaymentDestroyCmdExe;
|
|
||||||
import com.xunhong.erp.turbo.biz.app.executor.cmd.ReconciliationPaymentUpdateCmdExe;
|
|
||||||
import com.xunhong.erp.turbo.biz.app.executor.query.ReconciliationPaymentListQryExe;
|
|
||||||
import com.xunhong.erp.turbo.biz.app.executor.query.ReconciliationPaymentPageQryExe;
|
|
||||||
import com.xunhong.erp.turbo.biz.app.executor.query.ReconciliationPaymentShowQryExe;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.apache.dubbo.config.annotation.DubboService;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author shenyifei
|
|
||||||
*/
|
|
||||||
@Slf4j
|
|
||||||
@Service
|
|
||||||
@DubboService(interfaceClass = ReconciliationPaymentServiceI.class, version = "1.0.0")
|
|
||||||
@RequiredArgsConstructor
|
|
||||||
public class ReconciliationPaymentServiceImpl implements ReconciliationPaymentServiceI {
|
|
||||||
|
|
||||||
private final ReconciliationPaymentCreateCmdExe reconciliationPaymentCreateCmdExe;
|
|
||||||
private final ReconciliationPaymentUpdateCmdExe reconciliationPaymentUpdateCmdExe;
|
|
||||||
private final ReconciliationPaymentPageQryExe reconciliationPaymentPageQryExe;
|
|
||||||
private final ReconciliationPaymentListQryExe reconciliationPaymentListQryExe;
|
|
||||||
private final ReconciliationPaymentShowQryExe reconciliationPaymentShowQryExe;
|
|
||||||
private final ReconciliationPaymentDestroyCmdExe reconciliationPaymentDestroyCmdExe;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public ReconciliationPaymentVO create(ReconciliationPaymentCreateCmd reconciliationPaymentCreateCmd) {
|
|
||||||
return reconciliationPaymentCreateCmdExe.execute(reconciliationPaymentCreateCmd);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public PageDTO<ReconciliationPaymentVO> page(ReconciliationPaymentPageQry reconciliationPaymentPageQry) {
|
|
||||||
return PageDTO.of(reconciliationPaymentPageQryExe.execute(reconciliationPaymentPageQry));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<ReconciliationPaymentVO> list(ReconciliationPaymentListQry reconciliationPaymentListQry) {
|
|
||||||
return reconciliationPaymentListQryExe.execute(reconciliationPaymentListQry);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public ReconciliationPaymentVO update(ReconciliationPaymentUpdateCmd reconciliationPaymentUpdateCmd) {
|
|
||||||
return reconciliationPaymentUpdateCmdExe.execute(reconciliationPaymentUpdateCmd);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public ReconciliationPaymentVO show(ReconciliationPaymentShowQry reconciliationPaymentShowQry) {
|
|
||||||
return reconciliationPaymentShowQryExe.execute(reconciliationPaymentShowQry);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void destroy(ReconciliationPaymentDestroyCmd reconciliationPaymentDestroyCmd) {
|
|
||||||
reconciliationPaymentDestroyCmdExe.execute(reconciliationPaymentDestroyCmd);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@ -1,79 +0,0 @@
|
|||||||
package com.xunhong.erp.turbo.biz.app.service;
|
|
||||||
|
|
||||||
import com.xunhong.erp.turbo.api.biz.api.ReconciliationServiceI;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.cmd.ReconciliationCompleteCmd;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.cmd.ReconciliationCreateCmd;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.cmd.ReconciliationDestroyCmd;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.cmd.ReconciliationUpdateCmd;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.qry.ReconciliationListQry;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.qry.ReconciliationPageQry;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.qry.ReconciliationShowQry;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.vo.ReconciliationVO;
|
|
||||||
import com.xunhong.erp.turbo.base.dto.PageDTO;
|
|
||||||
import com.xunhong.erp.turbo.biz.app.executor.cmd.ReconciliationCompleteCmdExe;
|
|
||||||
import com.xunhong.erp.turbo.biz.app.executor.cmd.ReconciliationCreateCmdExe;
|
|
||||||
import com.xunhong.erp.turbo.biz.app.executor.cmd.ReconciliationDestroyCmdExe;
|
|
||||||
import com.xunhong.erp.turbo.biz.app.executor.cmd.ReconciliationUpdateCmdExe;
|
|
||||||
import com.xunhong.erp.turbo.biz.app.executor.query.ReconciliationListQryExe;
|
|
||||||
import com.xunhong.erp.turbo.biz.app.executor.query.ReconciliationPageQryExe;
|
|
||||||
import com.xunhong.erp.turbo.biz.app.executor.query.ReconciliationShowQryExe;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.apache.dubbo.config.annotation.DubboService;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author shenyifei
|
|
||||||
*/
|
|
||||||
@Slf4j
|
|
||||||
@Service
|
|
||||||
@DubboService(interfaceClass = ReconciliationServiceI.class, version = "1.0.0")
|
|
||||||
@RequiredArgsConstructor
|
|
||||||
public class ReconciliationServiceImpl implements ReconciliationServiceI {
|
|
||||||
|
|
||||||
private final ReconciliationCreateCmdExe reconciliationCreateCmdExe;
|
|
||||||
private final ReconciliationUpdateCmdExe reconciliationUpdateCmdExe;
|
|
||||||
private final ReconciliationPageQryExe reconciliationPageQryExe;
|
|
||||||
private final ReconciliationListQryExe reconciliationListQryExe;
|
|
||||||
private final ReconciliationShowQryExe reconciliationShowQryExe;
|
|
||||||
private final ReconciliationCompleteCmdExe reconciliationCompleteCmdExe;
|
|
||||||
private final ReconciliationDestroyCmdExe reconciliationDestroyCmdExe;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public ReconciliationVO create(ReconciliationCreateCmd reconciliationCreateCmd) {
|
|
||||||
return reconciliationCreateCmdExe.execute(reconciliationCreateCmd);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public PageDTO<ReconciliationVO> page(ReconciliationPageQry reconciliationPageQry) {
|
|
||||||
return PageDTO.of(reconciliationPageQryExe.execute(reconciliationPageQry));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<ReconciliationVO> list(ReconciliationListQry reconciliationListQry) {
|
|
||||||
return reconciliationListQryExe.execute(reconciliationListQry);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public ReconciliationVO update(ReconciliationUpdateCmd reconciliationUpdateCmd) {
|
|
||||||
return reconciliationUpdateCmdExe.execute(reconciliationUpdateCmd);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public ReconciliationVO show(ReconciliationShowQry reconciliationShowQry) {
|
|
||||||
return reconciliationShowQryExe.execute(reconciliationShowQry);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public ReconciliationVO complete(ReconciliationCompleteCmd reconciliationCompleteCmd) {
|
|
||||||
return reconciliationCompleteCmdExe.execute(reconciliationCompleteCmd);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void destroy(ReconciliationDestroyCmd reconciliationDestroyCmd) {
|
|
||||||
reconciliationDestroyCmdExe.execute(reconciliationDestroyCmd);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@ -1,82 +0,0 @@
|
|||||||
package com.xunhong.erp.turbo.biz.domain.entity;
|
|
||||||
|
|
||||||
import com.alibaba.cola.domain.Entity;
|
|
||||||
import com.alibaba.cola.dto.DTO;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.enums.DealerAccountRecordTargetTypeEnum;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.EqualsAndHashCode;
|
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author shenyifei
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@Entity
|
|
||||||
@EqualsAndHashCode(callSuper = true)
|
|
||||||
public class DealerAccountRecord extends DTO {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 应收账款明细ID
|
|
||||||
*/
|
|
||||||
private Long dealerAccountRecordId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 流水编号
|
|
||||||
*/
|
|
||||||
private String recordSn;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 经销商ID
|
|
||||||
*/
|
|
||||||
private Long dealerId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 订单ID
|
|
||||||
*/
|
|
||||||
private Long orderId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 变动对象ID
|
|
||||||
*/
|
|
||||||
private Long targetId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 变动类型:1-产地采购发货单;2-市场采购发货单;3-市场调货发货单;
|
|
||||||
*/
|
|
||||||
private DealerAccountRecordTargetTypeEnum targetType;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 变动前金额
|
|
||||||
*/
|
|
||||||
private BigDecimal beforeAmount;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 变动金额
|
|
||||||
*/
|
|
||||||
private BigDecimal amount;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 变动后金额
|
|
||||||
*/
|
|
||||||
private BigDecimal afterAmount;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 备注
|
|
||||||
*/
|
|
||||||
private String remark;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 创建时间
|
|
||||||
*/
|
|
||||||
private LocalDateTime createdAt;
|
|
||||||
|
|
||||||
private Dealer dealer;
|
|
||||||
|
|
||||||
private Order order;
|
|
||||||
|
|
||||||
private OrderShip orderShip;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@ -9,7 +9,6 @@ import com.xunhong.erp.turbo.api.biz.dto.enums.OrderShipTypeEnum;
|
|||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -117,16 +116,6 @@ public class OrderShip extends DTO {
|
|||||||
*/
|
*/
|
||||||
private String remark;
|
private String remark;
|
||||||
|
|
||||||
/**
|
|
||||||
* 应收金额(元)
|
|
||||||
*/
|
|
||||||
private BigDecimal receivableAmount;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 调整总额(元)
|
|
||||||
*/
|
|
||||||
private BigDecimal adjustedAmount;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建人ID
|
* 创建人ID
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -1,97 +0,0 @@
|
|||||||
package com.xunhong.erp.turbo.biz.domain.entity;
|
|
||||||
|
|
||||||
import com.alibaba.cola.domain.Entity;
|
|
||||||
import com.alibaba.cola.dto.DTO;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.enums.ReconciliationStateEnum;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.EqualsAndHashCode;
|
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author shenyifei
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@Entity
|
|
||||||
@EqualsAndHashCode(callSuper = true)
|
|
||||||
public class Reconciliation extends DTO {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 对账ID
|
|
||||||
*/
|
|
||||||
private Long reconciliationId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 对账编码
|
|
||||||
*/
|
|
||||||
private String reconciliationSn;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 经销商ID
|
|
||||||
*/
|
|
||||||
private Long dealerId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 公司ID
|
|
||||||
*/
|
|
||||||
private Long companyId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 原对账金额
|
|
||||||
*/
|
|
||||||
private BigDecimal originalAmount;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 是否抹零 1是0否
|
|
||||||
*/
|
|
||||||
private Boolean isRounding;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 抹零金额
|
|
||||||
*/
|
|
||||||
private BigDecimal roundingAmount;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 抹零备注
|
|
||||||
*/
|
|
||||||
private String roundingRemark;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 对账金额
|
|
||||||
*/
|
|
||||||
private BigDecimal reconciliationAmount;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 状态: 0-待对账, 1-已对账, 2-部分开票, 3-已开票, 4-部分回款, 5-已回款
|
|
||||||
*/
|
|
||||||
private ReconciliationStateEnum state;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 备注
|
|
||||||
*/
|
|
||||||
private String remark;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 创建时间
|
|
||||||
*/
|
|
||||||
private LocalDateTime createdAt;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 对账详情
|
|
||||||
*/
|
|
||||||
private List<OrderShip> orderShipList;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 公司信息
|
|
||||||
*/
|
|
||||||
private Company company;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 经销商信息
|
|
||||||
*/
|
|
||||||
private Dealer dealer;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@ -1,84 +0,0 @@
|
|||||||
package com.xunhong.erp.turbo.biz.domain.entity;
|
|
||||||
|
|
||||||
import com.alibaba.cola.domain.Entity;
|
|
||||||
import com.alibaba.cola.dto.DTO;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.common.UploadFileItem;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.EqualsAndHashCode;
|
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
import java.time.LocalDate;
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author shenyifei
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@Entity
|
|
||||||
@EqualsAndHashCode(callSuper = true)
|
|
||||||
public class ReconciliationInvoice extends DTO {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 对账发票ID
|
|
||||||
*/
|
|
||||||
private Long reconciliationInvoiceId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 对账ID
|
|
||||||
*/
|
|
||||||
private Long reconciliationId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 对账发票编码
|
|
||||||
*/
|
|
||||||
private String invoiceSn;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 经销商ID
|
|
||||||
*/
|
|
||||||
private Long dealerId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 经销商账户ID
|
|
||||||
*/
|
|
||||||
private Long accountId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 发票金额
|
|
||||||
*/
|
|
||||||
private BigDecimal invoiceAmount;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 入账公司ID
|
|
||||||
*/
|
|
||||||
private Long companyId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 发票日期
|
|
||||||
*/
|
|
||||||
private LocalDate invoiceDate;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 发票图片(支持多张)
|
|
||||||
*/
|
|
||||||
private List<UploadFileItem> invoiceImg;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 备注
|
|
||||||
*/
|
|
||||||
private String remark;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 创建时间
|
|
||||||
*/
|
|
||||||
private LocalDateTime createdAt;
|
|
||||||
|
|
||||||
private Dealer dealer;
|
|
||||||
|
|
||||||
private Company company;
|
|
||||||
|
|
||||||
private DealerPaymentAccount dealerPaymentAccount;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@ -1,37 +0,0 @@
|
|||||||
package com.xunhong.erp.turbo.biz.domain.entity;
|
|
||||||
|
|
||||||
import com.alibaba.cola.domain.Entity;
|
|
||||||
import com.alibaba.cola.dto.DTO;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.EqualsAndHashCode;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author shenyifei
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@Entity
|
|
||||||
@EqualsAndHashCode(callSuper = true)
|
|
||||||
public class ReconciliationItem extends DTO {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 对账记录ID
|
|
||||||
*/
|
|
||||||
private Long reconciliationItemId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 对账ID
|
|
||||||
*/
|
|
||||||
private Long reconciliationId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 订单ID
|
|
||||||
*/
|
|
||||||
private Long orderId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 发货单ID
|
|
||||||
*/
|
|
||||||
private Long orderShipId;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@ -1,95 +0,0 @@
|
|||||||
package com.xunhong.erp.turbo.biz.domain.entity;
|
|
||||||
|
|
||||||
import com.alibaba.cola.domain.Entity;
|
|
||||||
import com.alibaba.cola.dto.DTO;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.EqualsAndHashCode;
|
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author shenyifei
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@Entity
|
|
||||||
@EqualsAndHashCode(callSuper = true)
|
|
||||||
public class ReconciliationPayment extends DTO {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 对账付款ID
|
|
||||||
*/
|
|
||||||
private Long reconciliationPaymentId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 对账ID
|
|
||||||
*/
|
|
||||||
private Long reconciliationId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 经销商ID
|
|
||||||
*/
|
|
||||||
private Long dealerId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 我方收款公司ID
|
|
||||||
*/
|
|
||||||
private Long companyId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 我方收款公司账户ID
|
|
||||||
*/
|
|
||||||
private Long accountId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 账户类别:1_对公账户;2_私人账户
|
|
||||||
*/
|
|
||||||
private Boolean accountCategory;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 账户类型:1_银行卡;2_支付宝;3_微信
|
|
||||||
*/
|
|
||||||
private Boolean accountType;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 银行名称
|
|
||||||
*/
|
|
||||||
private String bankName;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 支行名称
|
|
||||||
*/
|
|
||||||
private String branchName;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 开户公司名称/支付宝昵称/微信号
|
|
||||||
*/
|
|
||||||
private String accountName;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 银行账号/支付宝账号/微信账号
|
|
||||||
*/
|
|
||||||
private String accountNumber;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 回款时间
|
|
||||||
*/
|
|
||||||
private LocalDateTime returnAt;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 回款金额
|
|
||||||
*/
|
|
||||||
private BigDecimal returnAmount;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 备注
|
|
||||||
*/
|
|
||||||
private String remark;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 创建时间
|
|
||||||
*/
|
|
||||||
private LocalDateTime createdAt;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@ -1,30 +0,0 @@
|
|||||||
package com.xunhong.erp.turbo.biz.domain.gateway;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.cmd.DealerAccountRecordCreateCmd;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.cmd.DealerAccountRecordDestroyCmd;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.cmd.DealerAccountRecordUpdateCmd;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.qry.DealerAccountRecordListQry;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.qry.DealerAccountRecordPageQry;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.qry.DealerAccountRecordShowQry;
|
|
||||||
import com.xunhong.erp.turbo.biz.domain.entity.DealerAccountRecord;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author shenyifei
|
|
||||||
*/
|
|
||||||
public interface DealerAccountRecordGateway {
|
|
||||||
DealerAccountRecord save(DealerAccountRecordCreateCmd dealerAccountRecordCreateCmd);
|
|
||||||
|
|
||||||
IPage<DealerAccountRecord> page(DealerAccountRecordPageQry dealerAccountRecordPageQry);
|
|
||||||
|
|
||||||
List<DealerAccountRecord> list(DealerAccountRecordListQry dealerAccountRecordListQry);
|
|
||||||
|
|
||||||
DealerAccountRecord update(DealerAccountRecordUpdateCmd dealerAccountRecordUpdateCmd);
|
|
||||||
|
|
||||||
DealerAccountRecord show(DealerAccountRecordShowQry dealerAccountRecordShowQry);
|
|
||||||
|
|
||||||
void destroy(DealerAccountRecordDestroyCmd dealerAccountRecordDestroyCmd);
|
|
||||||
}
|
|
||||||
|
|
||||||
@ -15,9 +15,7 @@ public interface OrderGateway {
|
|||||||
|
|
||||||
// 新增分步提交方法
|
// 新增分步提交方法
|
||||||
Order saveStep1(OrderStep1Cmd orderStep1Cmd);
|
Order saveStep1(OrderStep1Cmd orderStep1Cmd);
|
||||||
|
|
||||||
void saveStep2(OrderStep2Cmd orderStep2Cmd);
|
void saveStep2(OrderStep2Cmd orderStep2Cmd);
|
||||||
|
|
||||||
void saveStep3(OrderStep3Cmd orderStep3Cmd);
|
void saveStep3(OrderStep3Cmd orderStep3Cmd);
|
||||||
|
|
||||||
IPage<Order> page(OrderPageQry orderPageQry);
|
IPage<Order> page(OrderPageQry orderPageQry);
|
||||||
|
|||||||
@ -3,8 +3,8 @@ package com.xunhong.erp.turbo.biz.domain.gateway;
|
|||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.cmd.ProductCreateCmd;
|
import com.xunhong.erp.turbo.api.biz.dto.cmd.ProductCreateCmd;
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.cmd.ProductDestroyCmd;
|
import com.xunhong.erp.turbo.api.biz.dto.cmd.ProductDestroyCmd;
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.cmd.ProductDragCmd;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.cmd.ProductUpdateCmd;
|
import com.xunhong.erp.turbo.api.biz.dto.cmd.ProductUpdateCmd;
|
||||||
|
import com.xunhong.erp.turbo.api.biz.dto.cmd.ProductDragCmd;
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.qry.ProductListQry;
|
import com.xunhong.erp.turbo.api.biz.dto.qry.ProductListQry;
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.qry.ProductPageQry;
|
import com.xunhong.erp.turbo.api.biz.dto.qry.ProductPageQry;
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.qry.ProductShowQry;
|
import com.xunhong.erp.turbo.api.biz.dto.qry.ProductShowQry;
|
||||||
|
|||||||
@ -1,33 +0,0 @@
|
|||||||
package com.xunhong.erp.turbo.biz.domain.gateway;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.cmd.ReconciliationCompleteCmd;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.cmd.ReconciliationCreateCmd;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.cmd.ReconciliationDestroyCmd;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.cmd.ReconciliationUpdateCmd;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.qry.ReconciliationListQry;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.qry.ReconciliationPageQry;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.qry.ReconciliationShowQry;
|
|
||||||
import com.xunhong.erp.turbo.biz.domain.entity.Reconciliation;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author shenyifei
|
|
||||||
*/
|
|
||||||
public interface ReconciliationGateway {
|
|
||||||
Reconciliation save(ReconciliationCreateCmd reconciliationCreateCmd);
|
|
||||||
|
|
||||||
IPage<Reconciliation> page(ReconciliationPageQry reconciliationPageQry);
|
|
||||||
|
|
||||||
List<Reconciliation> list(ReconciliationListQry reconciliationListQry);
|
|
||||||
|
|
||||||
Reconciliation update(ReconciliationUpdateCmd reconciliationUpdateCmd);
|
|
||||||
|
|
||||||
Reconciliation show(ReconciliationShowQry reconciliationShowQry);
|
|
||||||
|
|
||||||
Reconciliation complete(ReconciliationCompleteCmd reconciliationCompleteCmd);
|
|
||||||
|
|
||||||
void destroy(ReconciliationDestroyCmd reconciliationDestroyCmd);
|
|
||||||
}
|
|
||||||
|
|
||||||
@ -1,30 +0,0 @@
|
|||||||
package com.xunhong.erp.turbo.biz.domain.gateway;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.cmd.ReconciliationInvoiceCreateCmd;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.cmd.ReconciliationInvoiceDestroyCmd;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.cmd.ReconciliationInvoiceUpdateCmd;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.qry.ReconciliationInvoiceListQry;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.qry.ReconciliationInvoicePageQry;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.qry.ReconciliationInvoiceShowQry;
|
|
||||||
import com.xunhong.erp.turbo.biz.domain.entity.ReconciliationInvoice;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author shenyifei
|
|
||||||
*/
|
|
||||||
public interface ReconciliationInvoiceGateway {
|
|
||||||
ReconciliationInvoice save(ReconciliationInvoiceCreateCmd reconciliationInvoiceCreateCmd);
|
|
||||||
|
|
||||||
IPage<ReconciliationInvoice> page(ReconciliationInvoicePageQry reconciliationInvoicePageQry);
|
|
||||||
|
|
||||||
List<ReconciliationInvoice> list(ReconciliationInvoiceListQry reconciliationInvoiceListQry);
|
|
||||||
|
|
||||||
ReconciliationInvoice update(ReconciliationInvoiceUpdateCmd reconciliationInvoiceUpdateCmd);
|
|
||||||
|
|
||||||
ReconciliationInvoice show(ReconciliationInvoiceShowQry reconciliationInvoiceShowQry);
|
|
||||||
|
|
||||||
void destroy(ReconciliationInvoiceDestroyCmd reconciliationInvoiceDestroyCmd);
|
|
||||||
}
|
|
||||||
|
|
||||||
@ -1,30 +0,0 @@
|
|||||||
package com.xunhong.erp.turbo.biz.domain.gateway;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.cmd.ReconciliationPaymentCreateCmd;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.cmd.ReconciliationPaymentDestroyCmd;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.cmd.ReconciliationPaymentUpdateCmd;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.qry.ReconciliationPaymentListQry;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.qry.ReconciliationPaymentPageQry;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.qry.ReconciliationPaymentShowQry;
|
|
||||||
import com.xunhong.erp.turbo.biz.domain.entity.ReconciliationPayment;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author shenyifei
|
|
||||||
*/
|
|
||||||
public interface ReconciliationPaymentGateway {
|
|
||||||
ReconciliationPayment save(ReconciliationPaymentCreateCmd reconciliationPaymentCreateCmd);
|
|
||||||
|
|
||||||
IPage<ReconciliationPayment> page(ReconciliationPaymentPageQry reconciliationPaymentPageQry);
|
|
||||||
|
|
||||||
List<ReconciliationPayment> list(ReconciliationPaymentListQry reconciliationPaymentListQry);
|
|
||||||
|
|
||||||
ReconciliationPayment update(ReconciliationPaymentUpdateCmd reconciliationPaymentUpdateCmd);
|
|
||||||
|
|
||||||
ReconciliationPayment show(ReconciliationPaymentShowQry reconciliationPaymentShowQry);
|
|
||||||
|
|
||||||
void destroy(ReconciliationPaymentDestroyCmd reconciliationPaymentDestroyCmd);
|
|
||||||
}
|
|
||||||
|
|
||||||
@ -1,41 +0,0 @@
|
|||||||
package com.xunhong.erp.turbo.biz.infrastructure.convert;
|
|
||||||
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.cmd.DealerAccountRecordCreateCmd;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.cmd.DealerAccountRecordUpdateCmd;
|
|
||||||
import com.xunhong.erp.turbo.biz.domain.entity.DealerAccountRecord;
|
|
||||||
import com.xunhong.erp.turbo.biz.infrastructure.entity.DealerAccountRecordDO;
|
|
||||||
import org.mapstruct.Mapper;
|
|
||||||
import org.mapstruct.Mapping;
|
|
||||||
import org.mapstruct.MappingTarget;
|
|
||||||
import org.mapstruct.NullValueCheckStrategy;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author shenyifei
|
|
||||||
*/
|
|
||||||
@Mapper(componentModel = "spring", nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS, uses = {OrderConvert.class})
|
|
||||||
public interface DealerAccountRecordConvert {
|
|
||||||
|
|
||||||
@Mapping(target = "dealer", source = "dealerDO")
|
|
||||||
@Mapping(target = "orderShip", source = "orderShipDO")
|
|
||||||
@Mapping(target = "order", source = "orderDO")
|
|
||||||
DealerAccountRecord toDealerAccountRecord(DealerAccountRecordDO dealerAccountRecordDO);
|
|
||||||
|
|
||||||
@Mapping(target = "orderShipDO", ignore = true)
|
|
||||||
@Mapping(target = "orderDO", ignore = true)
|
|
||||||
@Mapping(target = "dealerDO", ignore = true)
|
|
||||||
@Mapping(target = "version", ignore = true)
|
|
||||||
@Mapping(target = "updatedAt", ignore = true)
|
|
||||||
@Mapping(target = "isDelete", ignore = true)
|
|
||||||
@Mapping(target = "createdAt", ignore = true)
|
|
||||||
DealerAccountRecordDO toDealerAccountRecordDO(DealerAccountRecordCreateCmd dealerAccountRecordCreateCmd);
|
|
||||||
|
|
||||||
@Mapping(target = "orderShipDO", ignore = true)
|
|
||||||
@Mapping(target = "orderDO", ignore = true)
|
|
||||||
@Mapping(target = "dealerDO", ignore = true)
|
|
||||||
@Mapping(target = "version", ignore = true)
|
|
||||||
@Mapping(target = "updatedAt", ignore = true)
|
|
||||||
@Mapping(target = "isDelete", ignore = true)
|
|
||||||
@Mapping(target = "createdAt", ignore = true)
|
|
||||||
void toDealerAccountRecordDO(@MappingTarget DealerAccountRecordDO dealerAccountRecordDO, DealerAccountRecordUpdateCmd dealerAccountRecordUpdateCmd);
|
|
||||||
}
|
|
||||||
|
|
||||||
@ -1,46 +0,0 @@
|
|||||||
package com.xunhong.erp.turbo.biz.infrastructure.convert;
|
|
||||||
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.cmd.ReconciliationCreateCmd;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.cmd.ReconciliationUpdateCmd;
|
|
||||||
import com.xunhong.erp.turbo.biz.domain.entity.Reconciliation;
|
|
||||||
import com.xunhong.erp.turbo.biz.infrastructure.entity.ReconciliationDO;
|
|
||||||
import org.mapstruct.Mapper;
|
|
||||||
import org.mapstruct.Mapping;
|
|
||||||
import org.mapstruct.MappingTarget;
|
|
||||||
import org.mapstruct.NullValueCheckStrategy;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author shenyifei
|
|
||||||
*/
|
|
||||||
@Mapper(componentModel = "spring", nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS)
|
|
||||||
public interface ReconciliationConvert {
|
|
||||||
|
|
||||||
@Mapping(target = "dealer", source = "dealerDO")
|
|
||||||
@Mapping(target = "company", source = "companyDO")
|
|
||||||
@Mapping(target = "orderShipList", source = "orderShipDOList")
|
|
||||||
Reconciliation toReconciliation(ReconciliationDO reconciliationDO);
|
|
||||||
|
|
||||||
@Mapping(target = "dealerDO", ignore = true)
|
|
||||||
@Mapping(target = "companyDO", ignore = true)
|
|
||||||
@Mapping(target = "state", ignore = true)
|
|
||||||
@Mapping(target = "reconciliationSn", ignore = true)
|
|
||||||
@Mapping(target = "reconciliationId", ignore = true)
|
|
||||||
@Mapping(target = "orderShipDOList", ignore = true)
|
|
||||||
@Mapping(target = "version", ignore = true)
|
|
||||||
@Mapping(target = "updatedAt", ignore = true)
|
|
||||||
@Mapping(target = "isDelete", ignore = true)
|
|
||||||
@Mapping(target = "createdAt", ignore = true)
|
|
||||||
ReconciliationDO toReconciliationDO(ReconciliationCreateCmd reconciliationCreateCmd);
|
|
||||||
|
|
||||||
@Mapping(target = "dealerDO", ignore = true)
|
|
||||||
@Mapping(target = "companyDO", ignore = true)
|
|
||||||
@Mapping(target = "state", ignore = true)
|
|
||||||
@Mapping(target = "reconciliationSn", ignore = true)
|
|
||||||
@Mapping(target = "orderShipDOList", ignore = true)
|
|
||||||
@Mapping(target = "version", ignore = true)
|
|
||||||
@Mapping(target = "updatedAt", ignore = true)
|
|
||||||
@Mapping(target = "isDelete", ignore = true)
|
|
||||||
@Mapping(target = "createdAt", ignore = true)
|
|
||||||
void toReconciliationDO(@MappingTarget ReconciliationDO reconciliationDO, ReconciliationUpdateCmd reconciliationUpdateCmd);
|
|
||||||
}
|
|
||||||
|
|
||||||
@ -1,41 +0,0 @@
|
|||||||
package com.xunhong.erp.turbo.biz.infrastructure.convert;
|
|
||||||
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.cmd.ReconciliationInvoiceCreateCmd;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.cmd.ReconciliationInvoiceUpdateCmd;
|
|
||||||
import com.xunhong.erp.turbo.biz.domain.entity.ReconciliationInvoice;
|
|
||||||
import com.xunhong.erp.turbo.biz.infrastructure.entity.ReconciliationInvoiceDO;
|
|
||||||
import org.mapstruct.Mapper;
|
|
||||||
import org.mapstruct.Mapping;
|
|
||||||
import org.mapstruct.MappingTarget;
|
|
||||||
import org.mapstruct.NullValueCheckStrategy;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author shenyifei
|
|
||||||
*/
|
|
||||||
@Mapper(componentModel = "spring", nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS)
|
|
||||||
public interface ReconciliationInvoiceConvert {
|
|
||||||
|
|
||||||
@Mapping(target = "dealer", source = "dealerDO")
|
|
||||||
@Mapping(target = "dealerPaymentAccount", source = "dealerPaymentAccountDO")
|
|
||||||
@Mapping(target = "company", source = "companyDO")
|
|
||||||
ReconciliationInvoice toReconciliationInvoice(ReconciliationInvoiceDO reconciliationInvoiceDO);
|
|
||||||
|
|
||||||
@Mapping(target = "dealerPaymentAccountDO", ignore = true)
|
|
||||||
@Mapping(target = "dealerDO", ignore = true)
|
|
||||||
@Mapping(target = "companyDO", ignore = true)
|
|
||||||
@Mapping(target = "version", ignore = true)
|
|
||||||
@Mapping(target = "updatedAt", ignore = true)
|
|
||||||
@Mapping(target = "isDelete", ignore = true)
|
|
||||||
@Mapping(target = "createdAt", ignore = true)
|
|
||||||
ReconciliationInvoiceDO toReconciliationInvoiceDO(ReconciliationInvoiceCreateCmd reconciliationInvoiceCreateCmd);
|
|
||||||
|
|
||||||
@Mapping(target = "dealerPaymentAccountDO", ignore = true)
|
|
||||||
@Mapping(target = "dealerDO", ignore = true)
|
|
||||||
@Mapping(target = "companyDO", ignore = true)
|
|
||||||
@Mapping(target = "version", ignore = true)
|
|
||||||
@Mapping(target = "updatedAt", ignore = true)
|
|
||||||
@Mapping(target = "isDelete", ignore = true)
|
|
||||||
@Mapping(target = "createdAt", ignore = true)
|
|
||||||
void toReconciliationInvoiceDO(@MappingTarget ReconciliationInvoiceDO reconciliationInvoiceDO, ReconciliationInvoiceUpdateCmd reconciliationInvoiceUpdateCmd);
|
|
||||||
}
|
|
||||||
|
|
||||||
@ -1,18 +0,0 @@
|
|||||||
package com.xunhong.erp.turbo.biz.infrastructure.convert;
|
|
||||||
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.vo.OrderShipVO;
|
|
||||||
import com.xunhong.erp.turbo.biz.infrastructure.entity.ReconciliationItemDO;
|
|
||||||
import org.mapstruct.Mapper;
|
|
||||||
import org.mapstruct.NullValueCheckStrategy;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author shenyifei
|
|
||||||
*/
|
|
||||||
@Mapper(componentModel = "spring", nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS)
|
|
||||||
public interface ReconciliationItemConvert {
|
|
||||||
|
|
||||||
List<ReconciliationItemDO> toReconciliationItemList(List<OrderShipVO> orderShipVOList);
|
|
||||||
}
|
|
||||||
|
|
||||||
@ -1,32 +0,0 @@
|
|||||||
package com.xunhong.erp.turbo.biz.infrastructure.convert;
|
|
||||||
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.cmd.ReconciliationPaymentCreateCmd;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.cmd.ReconciliationPaymentUpdateCmd;
|
|
||||||
import com.xunhong.erp.turbo.biz.domain.entity.ReconciliationPayment;
|
|
||||||
import com.xunhong.erp.turbo.biz.infrastructure.entity.ReconciliationPaymentDO;
|
|
||||||
import org.mapstruct.Mapper;
|
|
||||||
import org.mapstruct.Mapping;
|
|
||||||
import org.mapstruct.MappingTarget;
|
|
||||||
import org.mapstruct.NullValueCheckStrategy;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author shenyifei
|
|
||||||
*/
|
|
||||||
@Mapper(componentModel = "spring", nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS)
|
|
||||||
public interface ReconciliationPaymentConvert {
|
|
||||||
|
|
||||||
ReconciliationPayment toReconciliationPayment(ReconciliationPaymentDO reconciliationPaymentDO);
|
|
||||||
|
|
||||||
@Mapping(target = "version", ignore = true)
|
|
||||||
@Mapping(target = "updatedAt", ignore = true)
|
|
||||||
@Mapping(target = "isDelete", ignore = true)
|
|
||||||
@Mapping(target = "createdAt", ignore = true)
|
|
||||||
ReconciliationPaymentDO toReconciliationPaymentDO(ReconciliationPaymentCreateCmd reconciliationPaymentCreateCmd);
|
|
||||||
|
|
||||||
@Mapping(target = "version", ignore = true)
|
|
||||||
@Mapping(target = "updatedAt", ignore = true)
|
|
||||||
@Mapping(target = "isDelete", ignore = true)
|
|
||||||
@Mapping(target = "createdAt", ignore = true)
|
|
||||||
void toReconciliationPaymentDO(@MappingTarget ReconciliationPaymentDO reconciliationPaymentDO, ReconciliationPaymentUpdateCmd reconciliationPaymentUpdateCmd);
|
|
||||||
}
|
|
||||||
|
|
||||||
@ -1,91 +0,0 @@
|
|||||||
package com.xunhong.erp.turbo.biz.infrastructure.entity;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.enums.DealerAccountRecordTargetTypeEnum;
|
|
||||||
import com.xunhong.erp.turbo.datasource.domain.entity.BaseDO;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.EqualsAndHashCode;
|
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author shenyifei
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@TableName(value = "dealer_account_record")
|
|
||||||
@EqualsAndHashCode(callSuper = true)
|
|
||||||
public class DealerAccountRecordDO extends BaseDO<DealerAccountRecordDO> {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 应收账款明细ID
|
|
||||||
*/
|
|
||||||
@TableId(value = "dealer_account_record_id", type = IdType.ASSIGN_ID)
|
|
||||||
private Long dealerAccountRecordId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 流水编号
|
|
||||||
*/
|
|
||||||
@TableField(value = "record_sn")
|
|
||||||
private String recordSn;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 经销商ID
|
|
||||||
*/
|
|
||||||
@TableField(value = "dealer_id")
|
|
||||||
private Long dealerId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 订单ID
|
|
||||||
*/
|
|
||||||
@TableField(value = "order_id")
|
|
||||||
private Long orderId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 变动对象ID
|
|
||||||
*/
|
|
||||||
@TableField(value = "target_id")
|
|
||||||
private Long targetId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 变动类型:1-产地采购发货单;2-市场采购发货单;3-市场调货发货单;
|
|
||||||
*/
|
|
||||||
@TableField(value = "target_type")
|
|
||||||
private DealerAccountRecordTargetTypeEnum targetType;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 变动前金额
|
|
||||||
*/
|
|
||||||
@TableField(value = "before_amount")
|
|
||||||
private BigDecimal beforeAmount;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 变动金额
|
|
||||||
*/
|
|
||||||
@TableField(value = "amount")
|
|
||||||
private BigDecimal amount;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 变动后金额
|
|
||||||
*/
|
|
||||||
@TableField(value = "after_amount")
|
|
||||||
private BigDecimal afterAmount;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 备注
|
|
||||||
*/
|
|
||||||
@TableField(value = "remark")
|
|
||||||
private String remark;
|
|
||||||
|
|
||||||
@TableField(exist = false)
|
|
||||||
private OrderDO orderDO;
|
|
||||||
|
|
||||||
@TableField(exist = false)
|
|
||||||
private DealerDO dealerDO;
|
|
||||||
|
|
||||||
@TableField(exist = false)
|
|
||||||
private OrderShipDO orderShipDO;
|
|
||||||
}
|
|
||||||
|
|
||||||
@ -11,7 +11,6 @@ import com.xunhong.erp.turbo.datasource.domain.entity.BaseDO;
|
|||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@ -138,18 +137,6 @@ public class OrderShipDO extends BaseDO<OrderShipDO> {
|
|||||||
@TableField(value = "remark")
|
@TableField(value = "remark")
|
||||||
private String remark;
|
private String remark;
|
||||||
|
|
||||||
/**
|
|
||||||
* 应收金额(元)
|
|
||||||
*/
|
|
||||||
@TableField(value = "receivable_amount")
|
|
||||||
private BigDecimal receivableAmount;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 调整总额(元)
|
|
||||||
*/
|
|
||||||
@TableField(value = "adjusted_amount")
|
|
||||||
private BigDecimal adjustedAmount;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建人ID
|
* 创建人ID
|
||||||
*/
|
*/
|
||||||
@ -176,7 +163,4 @@ public class OrderShipDO extends BaseDO<OrderShipDO> {
|
|||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private OrderDO orderDO;
|
private OrderDO orderDO;
|
||||||
|
|
||||||
@TableField(exist = false)
|
|
||||||
private Long reconciliationId;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -138,5 +138,16 @@ public class PaymentRecordDO extends BaseDO<PaymentRecordDO> {
|
|||||||
|
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private OrderCostDO orderCostDO;
|
private OrderCostDO orderCostDO;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 付款记录编号
|
||||||
|
*
|
||||||
|
* @return 付款记录编号
|
||||||
|
*/
|
||||||
|
public String generatePaymentRecordSn() {
|
||||||
|
// 生成类似 PAY20251105001 格式的编号
|
||||||
|
return "PAY" + java.time.LocalDate.now().format(java.time.format.DateTimeFormatter.BASIC_ISO_DATE)
|
||||||
|
+ String.format("%03d", System.currentTimeMillis() % 1000);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,98 +0,0 @@
|
|||||||
package com.xunhong.erp.turbo.biz.infrastructure.entity;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.enums.ReconciliationStateEnum;
|
|
||||||
import com.xunhong.erp.turbo.datasource.domain.entity.BaseDO;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.EqualsAndHashCode;
|
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author shenyifei
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@TableName(value = "reconciliation")
|
|
||||||
@EqualsAndHashCode(callSuper = true)
|
|
||||||
public class ReconciliationDO extends BaseDO<ReconciliationDO> {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 对账ID
|
|
||||||
*/
|
|
||||||
@TableId(value = "reconciliation_id", type = IdType.ASSIGN_ID)
|
|
||||||
private Long reconciliationId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 对账编码
|
|
||||||
*/
|
|
||||||
@TableField(value = "reconciliation_sn")
|
|
||||||
private String reconciliationSn;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 经销商ID
|
|
||||||
*/
|
|
||||||
@TableField(value = "dealer_id")
|
|
||||||
private Long dealerId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 公司ID
|
|
||||||
*/
|
|
||||||
@TableField(value = "company_id")
|
|
||||||
private Long companyId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 原对账金额
|
|
||||||
*/
|
|
||||||
@TableField(value = "original_amount")
|
|
||||||
private BigDecimal originalAmount;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 是否抹零 1是0否
|
|
||||||
*/
|
|
||||||
@TableField(value = "is_rounding")
|
|
||||||
private Boolean isRounding;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 抹零金额
|
|
||||||
*/
|
|
||||||
@TableField(value = "rounding_amount")
|
|
||||||
private BigDecimal roundingAmount;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 抹零备注
|
|
||||||
*/
|
|
||||||
@TableField(value = "rounding_remark")
|
|
||||||
private String roundingRemark;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 对账金额
|
|
||||||
*/
|
|
||||||
@TableField(value = "reconciliation_amount")
|
|
||||||
private BigDecimal reconciliationAmount;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 状态: 0-待对账, 1-已对账, 2-部分开票, 3-已开票, 4-部分回款, 5-已回款
|
|
||||||
*/
|
|
||||||
@TableField(value = "state")
|
|
||||||
private ReconciliationStateEnum state;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 备注
|
|
||||||
*/
|
|
||||||
@TableField(value = "remark")
|
|
||||||
private String remark;
|
|
||||||
|
|
||||||
@TableField(exist = false)
|
|
||||||
private List<OrderShipDO> orderShipDOList;
|
|
||||||
|
|
||||||
@TableField(exist = false)
|
|
||||||
private CompanyDO companyDO;
|
|
||||||
|
|
||||||
@TableField(exist = false)
|
|
||||||
private DealerDO dealerDO;
|
|
||||||
}
|
|
||||||
|
|
||||||
@ -1,95 +0,0 @@
|
|||||||
package com.xunhong.erp.turbo.biz.infrastructure.entity;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
|
||||||
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.common.UploadFileItem;
|
|
||||||
import com.xunhong.erp.turbo.datasource.domain.entity.BaseDO;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.EqualsAndHashCode;
|
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
import java.time.LocalDate;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author shenyifei
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@TableName(value = "reconciliation_invoice", autoResultMap = true)
|
|
||||||
@EqualsAndHashCode(callSuper = true)
|
|
||||||
public class ReconciliationInvoiceDO extends BaseDO<ReconciliationInvoiceDO> {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 对账发票ID
|
|
||||||
*/
|
|
||||||
@TableId(value = "reconciliation_invoice_id", type = IdType.ASSIGN_ID)
|
|
||||||
private Long reconciliationInvoiceId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 对账ID
|
|
||||||
*/
|
|
||||||
@TableField(value = "reconciliation_id")
|
|
||||||
private Long reconciliationId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 对账发票编码
|
|
||||||
*/
|
|
||||||
@TableField(value = "invoice_sn")
|
|
||||||
private String invoiceSn;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 经销商ID
|
|
||||||
*/
|
|
||||||
@TableField(value = "dealer_id")
|
|
||||||
private Long dealerId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 经销商账户ID
|
|
||||||
*/
|
|
||||||
@TableField(value = "account_id")
|
|
||||||
private Long accountId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 发票金额
|
|
||||||
*/
|
|
||||||
@TableField(value = "invoice_amount")
|
|
||||||
private BigDecimal invoiceAmount;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 入账公司ID
|
|
||||||
*/
|
|
||||||
@TableField(value = "company_id")
|
|
||||||
private Long companyId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 发票日期
|
|
||||||
*/
|
|
||||||
@TableField(value = "invoice_date")
|
|
||||||
private LocalDate invoiceDate;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 发票图片(支持多张)
|
|
||||||
*/
|
|
||||||
@TableField(value = "invoice_img", typeHandler = JacksonTypeHandler.class)
|
|
||||||
private List<UploadFileItem> invoiceImg;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 备注
|
|
||||||
*/
|
|
||||||
@TableField(value = "remark")
|
|
||||||
private String remark;
|
|
||||||
|
|
||||||
@TableField(exist = false)
|
|
||||||
private DealerDO dealerDO;
|
|
||||||
|
|
||||||
@TableField(exist = false)
|
|
||||||
private CompanyDO companyDO;
|
|
||||||
|
|
||||||
@TableField(exist = false)
|
|
||||||
private DealerPaymentAccountDO dealerPaymentAccountDO;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@ -1,50 +0,0 @@
|
|||||||
package com.xunhong.erp.turbo.biz.infrastructure.entity;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
|
||||||
import com.xunhong.erp.turbo.datasource.domain.entity.BaseDO;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.EqualsAndHashCode;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author shenyifei
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@TableName(value = "reconciliation_item")
|
|
||||||
@EqualsAndHashCode(callSuper = true)
|
|
||||||
public class ReconciliationItemDO extends BaseDO<ReconciliationItemDO> {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 对账记录ID
|
|
||||||
*/
|
|
||||||
@TableId(value = "reconciliation_item_id", type = IdType.ASSIGN_ID)
|
|
||||||
private Long reconciliationItemId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 对账ID
|
|
||||||
*/
|
|
||||||
@TableField(value = "reconciliation_id")
|
|
||||||
private Long reconciliationId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 订单ID
|
|
||||||
*/
|
|
||||||
@TableField(value = "order_id")
|
|
||||||
private Long orderId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 发货单ID
|
|
||||||
*/
|
|
||||||
@TableField(value = "order_ship_id")
|
|
||||||
private Long orderShipId;
|
|
||||||
|
|
||||||
@TableField(exist = false)
|
|
||||||
private OrderDO orderDO;
|
|
||||||
|
|
||||||
@TableField(exist = false)
|
|
||||||
private OrderShipDO orderShipDO;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@ -1,117 +0,0 @@
|
|||||||
package com.xunhong.erp.turbo.biz.infrastructure.entity;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
|
||||||
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.enums.CompanyPaymentAccountCategoryEnum;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.enums.CompanyPaymentAccountTypeEnum;
|
|
||||||
import com.xunhong.erp.turbo.datasource.domain.entity.BaseDO;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.EqualsAndHashCode;
|
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author shenyifei
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@TableName(value = "reconciliation_payment")
|
|
||||||
@EqualsAndHashCode(callSuper = true)
|
|
||||||
public class ReconciliationPaymentDO extends BaseDO<ReconciliationPaymentDO> {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 对账付款ID
|
|
||||||
*/
|
|
||||||
@TableId(value = "reconciliation_payment_id", type = IdType.ASSIGN_ID)
|
|
||||||
private Long reconciliationPaymentId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 对账ID
|
|
||||||
*/
|
|
||||||
@TableField(value = "reconciliation_id")
|
|
||||||
private Long reconciliationId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 经销商ID
|
|
||||||
*/
|
|
||||||
@TableField(value = "dealer_id")
|
|
||||||
private Long dealerId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 我方收款公司ID
|
|
||||||
*/
|
|
||||||
@TableField(value = "company_id")
|
|
||||||
private Long companyId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 我方收款公司账户ID
|
|
||||||
*/
|
|
||||||
@TableField(value = "account_id")
|
|
||||||
private Long accountId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 账户类别:1_对公账户;2_私人账户
|
|
||||||
*/
|
|
||||||
@TableField(value = "account_category")
|
|
||||||
private CompanyPaymentAccountCategoryEnum accountCategory;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 账户类型:1_银行卡;2_支付宝;3_微信
|
|
||||||
*/
|
|
||||||
@TableField(value = "account_type")
|
|
||||||
private CompanyPaymentAccountTypeEnum accountType;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 银行名称
|
|
||||||
*/
|
|
||||||
@TableField(value = "bank_name")
|
|
||||||
private String bankName;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 支行名称
|
|
||||||
*/
|
|
||||||
@TableField(value = "branch_name")
|
|
||||||
private String branchName;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 开户公司名称/支付宝昵称/微信号
|
|
||||||
*/
|
|
||||||
@TableField(value = "account_name")
|
|
||||||
private String accountName;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 银行账号/支付宝账号/微信账号
|
|
||||||
*/
|
|
||||||
@TableField(value = "account_number")
|
|
||||||
private String accountNumber;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 回款时间
|
|
||||||
*/
|
|
||||||
@TableField(value = "paid_at")
|
|
||||||
private LocalDateTime paidAt;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 回款金额
|
|
||||||
*/
|
|
||||||
@TableField(value = "paid_amount")
|
|
||||||
private BigDecimal paidAmount;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 回款凭证
|
|
||||||
*/
|
|
||||||
@TableField(value = "paid_credentials", typeHandler = JacksonTypeHandler.class)
|
|
||||||
private List<String> paidCredentials;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 备注
|
|
||||||
*/
|
|
||||||
@TableField(value = "remark")
|
|
||||||
private String remark;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@ -68,8 +68,6 @@ public class BoxBrandGatewayImpl implements BoxBrandGateway {
|
|||||||
if (CollUtil.isNotEmpty(brandIdList)) {
|
if (CollUtil.isNotEmpty(brandIdList)) {
|
||||||
LambdaQueryWrapper<BoxProductDO> queryWrapper1 = Wrappers.lambdaQuery(BoxProductDO.class);
|
LambdaQueryWrapper<BoxProductDO> queryWrapper1 = Wrappers.lambdaQuery(BoxProductDO.class);
|
||||||
queryWrapper1.in(BoxProductDO::getBrandId, brandIdList);
|
queryWrapper1.in(BoxProductDO::getBrandId, brandIdList);
|
||||||
queryWrapper1.orderByAsc(BoxProductDO::getSort);
|
|
||||||
queryWrapper1.orderByDesc(BoxProductDO::getCreatedAt);
|
|
||||||
List<BoxProductDO> boxProductDOList = boxProductMapper.selectList(queryWrapper1);
|
List<BoxProductDO> boxProductDOList = boxProductMapper.selectList(queryWrapper1);
|
||||||
|
|
||||||
page.getRecords().forEach(boxBrandDO -> {
|
page.getRecords().forEach(boxBrandDO -> {
|
||||||
@ -99,7 +97,6 @@ public class BoxBrandGatewayImpl implements BoxBrandGateway {
|
|||||||
if (CollUtil.isNotEmpty(brandIdList)) {
|
if (CollUtil.isNotEmpty(brandIdList)) {
|
||||||
LambdaQueryWrapper<BoxProductDO> queryWrapper1 = Wrappers.lambdaQuery(BoxProductDO.class);
|
LambdaQueryWrapper<BoxProductDO> queryWrapper1 = Wrappers.lambdaQuery(BoxProductDO.class);
|
||||||
queryWrapper1.in(BoxProductDO::getBrandId, brandIdList);
|
queryWrapper1.in(BoxProductDO::getBrandId, brandIdList);
|
||||||
queryWrapper1.orderByAsc(BoxProductDO::getSort);
|
|
||||||
queryWrapper1.orderByDesc(BoxProductDO::getCreatedAt);
|
queryWrapper1.orderByDesc(BoxProductDO::getCreatedAt);
|
||||||
List<BoxProductDO> boxProductDOList = boxProductMapper.selectList(queryWrapper1);
|
List<BoxProductDO> boxProductDOList = boxProductMapper.selectList(queryWrapper1);
|
||||||
boxBrandDOList.forEach(boxBrandDO -> {
|
boxBrandDOList.forEach(boxBrandDO -> {
|
||||||
|
|||||||
@ -14,6 +14,7 @@ import com.xunhong.erp.turbo.api.biz.dto.qry.CompanyShowQry;
|
|||||||
import com.xunhong.erp.turbo.biz.domain.entity.Company;
|
import com.xunhong.erp.turbo.biz.domain.entity.Company;
|
||||||
import com.xunhong.erp.turbo.biz.domain.gateway.CompanyGateway;
|
import com.xunhong.erp.turbo.biz.domain.gateway.CompanyGateway;
|
||||||
import com.xunhong.erp.turbo.biz.infrastructure.convert.CompanyConvert;
|
import com.xunhong.erp.turbo.biz.infrastructure.convert.CompanyConvert;
|
||||||
|
import com.xunhong.erp.turbo.biz.infrastructure.entity.BoxProductDO;
|
||||||
import com.xunhong.erp.turbo.biz.infrastructure.entity.CompanyDO;
|
import com.xunhong.erp.turbo.biz.infrastructure.entity.CompanyDO;
|
||||||
import com.xunhong.erp.turbo.biz.infrastructure.mapper.CompanyMapper;
|
import com.xunhong.erp.turbo.biz.infrastructure.mapper.CompanyMapper;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
|
|||||||
@ -1,144 +0,0 @@
|
|||||||
package com.xunhong.erp.turbo.biz.infrastructure.gateway;
|
|
||||||
|
|
||||||
import cn.hutool.core.collection.CollUtil;
|
|
||||||
import cn.hutool.core.util.StrUtil;
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
||||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.cmd.DealerAccountRecordCreateCmd;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.cmd.DealerAccountRecordDestroyCmd;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.cmd.DealerAccountRecordUpdateCmd;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.enums.DealerAccountRecordTargetTypeEnum;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.qry.DealerAccountRecordListQry;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.qry.DealerAccountRecordPageQry;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.qry.DealerAccountRecordShowQry;
|
|
||||||
import com.xunhong.erp.turbo.biz.domain.entity.DealerAccountRecord;
|
|
||||||
import com.xunhong.erp.turbo.biz.domain.gateway.DealerAccountRecordGateway;
|
|
||||||
import com.xunhong.erp.turbo.biz.infrastructure.convert.DealerAccountRecordConvert;
|
|
||||||
import com.xunhong.erp.turbo.biz.infrastructure.entity.DealerAccountRecordDO;
|
|
||||||
import com.xunhong.erp.turbo.biz.infrastructure.entity.DealerDO;
|
|
||||||
import com.xunhong.erp.turbo.biz.infrastructure.entity.OrderDO;
|
|
||||||
import com.xunhong.erp.turbo.biz.infrastructure.entity.OrderShipDO;
|
|
||||||
import com.xunhong.erp.turbo.biz.infrastructure.mapper.DealerAccountRecordMapper;
|
|
||||||
import com.xunhong.erp.turbo.biz.infrastructure.mapper.DealerMapper;
|
|
||||||
import com.xunhong.erp.turbo.biz.infrastructure.mapper.OrderMapper;
|
|
||||||
import com.xunhong.erp.turbo.biz.infrastructure.mapper.OrderShipMapper;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
import org.springframework.stereotype.Repository;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.Objects;
|
|
||||||
import java.util.Set;
|
|
||||||
import java.util.function.Function;
|
|
||||||
import java.util.stream.Collectors;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author shenyifei
|
|
||||||
*/
|
|
||||||
@Repository
|
|
||||||
@RequiredArgsConstructor
|
|
||||||
public class DealerAccountRecordGatewayImpl implements DealerAccountRecordGateway {
|
|
||||||
private final DealerAccountRecordMapper dealerAccountRecordMapper;
|
|
||||||
private final DealerAccountRecordConvert dealerAccountRecordConvert;
|
|
||||||
|
|
||||||
private final OrderMapper orderMapper;
|
|
||||||
private final DealerMapper dealerMapper;
|
|
||||||
private final OrderShipMapper orderShipMapper;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public DealerAccountRecord save(DealerAccountRecordCreateCmd dealerAccountRecordCreateCmd) {
|
|
||||||
DealerAccountRecordDO dealerAccountRecordDO = dealerAccountRecordConvert.toDealerAccountRecordDO(dealerAccountRecordCreateCmd);
|
|
||||||
dealerAccountRecordMapper.insert(dealerAccountRecordDO);
|
|
||||||
|
|
||||||
return dealerAccountRecordConvert.toDealerAccountRecord(dealerAccountRecordDO);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public IPage<DealerAccountRecord> page(DealerAccountRecordPageQry dealerAccountRecordPageQry) {
|
|
||||||
LambdaQueryWrapper<DealerAccountRecordDO> queryWrapper = Wrappers.lambdaQuery(DealerAccountRecordDO.class);
|
|
||||||
queryWrapper.eq(Objects.nonNull(dealerAccountRecordPageQry.getDealerAccountRecordId()), DealerAccountRecordDO::getDealerAccountRecordId, dealerAccountRecordPageQry.getDealerAccountRecordId());
|
|
||||||
queryWrapper.eq(Objects.nonNull(dealerAccountRecordPageQry.getDealerId()), DealerAccountRecordDO::getDealerId, dealerAccountRecordPageQry.getDealerId());
|
|
||||||
queryWrapper.eq(Objects.nonNull(dealerAccountRecordPageQry.getOrderId()), DealerAccountRecordDO::getOrderId, dealerAccountRecordPageQry.getOrderId());
|
|
||||||
queryWrapper.eq(Objects.nonNull(dealerAccountRecordPageQry.getTargetType()), DealerAccountRecordDO::getTargetType, dealerAccountRecordPageQry.getTargetType());
|
|
||||||
queryWrapper.eq(Objects.nonNull(dealerAccountRecordPageQry.getTargetId()), DealerAccountRecordDO::getTargetId, dealerAccountRecordPageQry.getTargetId());
|
|
||||||
queryWrapper.like(StrUtil.isNotBlank(dealerAccountRecordPageQry.getRecordSn()), DealerAccountRecordDO::getRecordSn, dealerAccountRecordPageQry.getRecordSn());
|
|
||||||
queryWrapper.like(StrUtil.isNotBlank(dealerAccountRecordPageQry.getRemark()), DealerAccountRecordDO::getRemark, dealerAccountRecordPageQry.getRemark());
|
|
||||||
|
|
||||||
queryWrapper.orderByDesc(DealerAccountRecordDO::getCreatedAt);
|
|
||||||
|
|
||||||
IPage<DealerAccountRecordDO> page = new Page<>(dealerAccountRecordPageQry.getPageIndex(), dealerAccountRecordPageQry.getPageSize());
|
|
||||||
page = dealerAccountRecordMapper.selectPage(page, queryWrapper);
|
|
||||||
|
|
||||||
Set<Long> orderIdList = page.getRecords().stream().map(DealerAccountRecordDO::getOrderId).collect(Collectors.toSet());
|
|
||||||
if (CollUtil.isNotEmpty(orderIdList)) {
|
|
||||||
List<OrderDO> orderDOList = orderMapper.selectByOrderIdList(orderIdList);
|
|
||||||
Map<Long, OrderDO> orderDOMap = orderDOList.stream().collect(Collectors.toMap(OrderDO::getOrderId, Function.identity()));
|
|
||||||
page.getRecords().forEach(dealerAccountRecordDO -> dealerAccountRecordDO.setOrderDO(orderDOMap.get(dealerAccountRecordDO.getOrderId())));
|
|
||||||
}
|
|
||||||
|
|
||||||
Set<Long> dealerIdList = page.getRecords().stream().map(DealerAccountRecordDO::getDealerId).collect(Collectors.toSet());
|
|
||||||
if (CollUtil.isNotEmpty(dealerIdList)) {
|
|
||||||
List<DealerDO> dealerDOList = dealerMapper.selectByIds(dealerIdList);
|
|
||||||
Map<Long, DealerDO> dealerDOMap = dealerDOList.stream().collect(Collectors.toMap(DealerDO::getDealerId, Function.identity()));
|
|
||||||
page.getRecords().forEach(dealerAccountRecordDO -> dealerAccountRecordDO.setDealerDO(dealerDOMap.get(dealerAccountRecordDO.getDealerId())));
|
|
||||||
}
|
|
||||||
|
|
||||||
Set<Long> orderShipIdList = page.getRecords().stream().filter(dealerAccountRecordDO -> {
|
|
||||||
return dealerAccountRecordDO.getTargetType().equals(DealerAccountRecordTargetTypeEnum.MARKET_PURCHASE_SHIP)
|
|
||||||
|| dealerAccountRecordDO.getTargetType().equals(DealerAccountRecordTargetTypeEnum.MARKET_TRANSFER_SHIP)
|
|
||||||
|| dealerAccountRecordDO.getTargetType().equals(DealerAccountRecordTargetTypeEnum.ORIGIN_PURCHASE_SHIP);
|
|
||||||
}).map(DealerAccountRecordDO::getTargetId).collect(Collectors.toSet());
|
|
||||||
|
|
||||||
if (CollUtil.isNotEmpty(orderShipIdList)) {
|
|
||||||
List<OrderShipDO> orderShipDOList = orderShipMapper.selectByIds(orderShipIdList);
|
|
||||||
Map<Long, OrderShipDO> orderShipDOMap = orderShipDOList.stream().collect(Collectors.toMap(OrderShipDO::getOrderShipId, Function.identity()));
|
|
||||||
page.getRecords().forEach(dealerAccountRecordDO -> dealerAccountRecordDO.setOrderShipDO(orderShipDOMap.get(dealerAccountRecordDO.getTargetId())));
|
|
||||||
}
|
|
||||||
|
|
||||||
return page.convert(dealerAccountRecordConvert::toDealerAccountRecord);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<DealerAccountRecord> list(DealerAccountRecordListQry dealerAccountRecordListQry) {
|
|
||||||
LambdaQueryWrapper<DealerAccountRecordDO> queryWrapper = Wrappers.lambdaQuery(DealerAccountRecordDO.class);
|
|
||||||
List<DealerAccountRecordDO> dealerAccountRecordDOList = dealerAccountRecordMapper.selectList(queryWrapper);
|
|
||||||
return dealerAccountRecordDOList.stream().map(dealerAccountRecordConvert::toDealerAccountRecord).toList();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public DealerAccountRecord update(DealerAccountRecordUpdateCmd dealerAccountRecordUpdateCmd) {
|
|
||||||
LambdaQueryWrapper<DealerAccountRecordDO> queryWrapper = Wrappers.lambdaQuery(DealerAccountRecordDO.class);
|
|
||||||
queryWrapper.eq(DealerAccountRecordDO::getDealerAccountRecordId, dealerAccountRecordUpdateCmd.getDealerAccountRecordId());
|
|
||||||
queryWrapper.last("limit 1");
|
|
||||||
|
|
||||||
DealerAccountRecordDO dealerAccountRecordDO = dealerAccountRecordMapper.selectOne(queryWrapper);
|
|
||||||
|
|
||||||
dealerAccountRecordConvert.toDealerAccountRecordDO(dealerAccountRecordDO, dealerAccountRecordUpdateCmd);
|
|
||||||
dealerAccountRecordMapper.updateById(dealerAccountRecordDO);
|
|
||||||
|
|
||||||
return dealerAccountRecordConvert.toDealerAccountRecord(dealerAccountRecordDO);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public DealerAccountRecord show(DealerAccountRecordShowQry dealerAccountRecordShowQry) {
|
|
||||||
LambdaQueryWrapper<DealerAccountRecordDO> queryWrapper = Wrappers.lambdaQuery(DealerAccountRecordDO.class);
|
|
||||||
queryWrapper.eq(DealerAccountRecordDO::getDealerAccountRecordId, dealerAccountRecordShowQry.getDealerAccountRecordId());
|
|
||||||
queryWrapper.last("limit 1");
|
|
||||||
|
|
||||||
DealerAccountRecordDO dealerAccountRecordDO = dealerAccountRecordMapper.selectOne(queryWrapper);
|
|
||||||
return dealerAccountRecordConvert.toDealerAccountRecord(dealerAccountRecordDO);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void destroy(DealerAccountRecordDestroyCmd dealerAccountRecordDestroyCmd) {
|
|
||||||
LambdaQueryWrapper<DealerAccountRecordDO> queryWrapper = Wrappers.lambdaQuery(DealerAccountRecordDO.class);
|
|
||||||
queryWrapper.eq(DealerAccountRecordDO::getDealerAccountRecordId, dealerAccountRecordDestroyCmd.getDealerAccountRecordId());
|
|
||||||
queryWrapper.last("limit 1");
|
|
||||||
|
|
||||||
DealerAccountRecordDO dealerAccountRecordDO = dealerAccountRecordMapper.selectOne(queryWrapper);
|
|
||||||
dealerAccountRecordDO.deleteById();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@ -20,7 +20,6 @@ import com.xunhong.erp.turbo.biz.infrastructure.convert.OrderCostConvert;
|
|||||||
import com.xunhong.erp.turbo.biz.infrastructure.convert.PaymentRecordConvert;
|
import com.xunhong.erp.turbo.biz.infrastructure.convert.PaymentRecordConvert;
|
||||||
import com.xunhong.erp.turbo.biz.infrastructure.entity.*;
|
import com.xunhong.erp.turbo.biz.infrastructure.entity.*;
|
||||||
import com.xunhong.erp.turbo.biz.infrastructure.mapper.*;
|
import com.xunhong.erp.turbo.biz.infrastructure.mapper.*;
|
||||||
import com.xunhong.erp.turbo.biz.util.SerialNumberGenerator;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.stereotype.Repository;
|
import org.springframework.stereotype.Repository;
|
||||||
@ -138,7 +137,7 @@ public class OrderCostGatewayImpl implements OrderCostGateway {
|
|||||||
}
|
}
|
||||||
|
|
||||||
PaymentRecordDO paymentRecordDO = orderCostConvert.toPaymentRecordDO(orderCostPayCmd);
|
PaymentRecordDO paymentRecordDO = orderCostConvert.toPaymentRecordDO(orderCostPayCmd);
|
||||||
paymentRecordDO.setPaymentRecordSn(SerialNumberGenerator.generate("PAY"));
|
paymentRecordDO.setPaymentRecordSn(paymentRecordDO.generatePaymentRecordSn());
|
||||||
paymentRecordDO.setTargetId(orderCostPayCmd.getOrderCostId());
|
paymentRecordDO.setTargetId(orderCostPayCmd.getOrderCostId());
|
||||||
paymentRecordDO.setTargetType(PaymentTargetTypeEnum.ORDER_COST);
|
paymentRecordDO.setTargetType(PaymentTargetTypeEnum.ORDER_COST);
|
||||||
paymentRecordDO.setPaidState(PaymentRecordStateEnum.PAID);
|
paymentRecordDO.setPaidState(PaymentRecordStateEnum.PAID);
|
||||||
|
|||||||
@ -18,7 +18,6 @@ import com.xunhong.erp.turbo.biz.domain.gateway.OrderGateway;
|
|||||||
import com.xunhong.erp.turbo.biz.infrastructure.convert.*;
|
import com.xunhong.erp.turbo.biz.infrastructure.convert.*;
|
||||||
import com.xunhong.erp.turbo.biz.infrastructure.entity.*;
|
import com.xunhong.erp.turbo.biz.infrastructure.entity.*;
|
||||||
import com.xunhong.erp.turbo.biz.infrastructure.mapper.*;
|
import com.xunhong.erp.turbo.biz.infrastructure.mapper.*;
|
||||||
import com.xunhong.erp.turbo.biz.util.SerialNumberGenerator;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.stereotype.Repository;
|
import org.springframework.stereotype.Repository;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
@ -69,8 +68,6 @@ public class OrderGatewayImpl implements OrderGateway {
|
|||||||
private final DealerMapper dealerMapper;
|
private final DealerMapper dealerMapper;
|
||||||
private final SupplierInvoiceMapper supplierInvoiceMapper;
|
private final SupplierInvoiceMapper supplierInvoiceMapper;
|
||||||
|
|
||||||
private final DealerAccountRecordMapper dealerAccountRecordMapper;
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional
|
@Transactional
|
||||||
public Order save(OrderCreateCmd orderCreateCmd) {
|
public Order save(OrderCreateCmd orderCreateCmd) {
|
||||||
@ -431,7 +428,7 @@ public class OrderGatewayImpl implements OrderGateway {
|
|||||||
orderShipDO.setOrderShipId(null);
|
orderShipDO.setOrderShipId(null);
|
||||||
// 生成发货单编号
|
// 生成发货单编号
|
||||||
if (StrUtil.isBlank(orderShipDO.getOrderSn())) {
|
if (StrUtil.isBlank(orderShipDO.getOrderSn())) {
|
||||||
orderShipDO.setOrderSn(SerialNumberGenerator.generate("FH"));
|
orderShipDO.setOrderSn("FH" + generateOrderShipSn());
|
||||||
}
|
}
|
||||||
shipsToInsert.add(orderShipDO);
|
shipsToInsert.add(orderShipDO);
|
||||||
}
|
}
|
||||||
@ -635,86 +632,17 @@ public class OrderGatewayImpl implements OrderGateway {
|
|||||||
updateWrapper.eq(OrderShipDO::getOrderId, orderDO.getOrderId());
|
updateWrapper.eq(OrderShipDO::getOrderId, orderDO.getOrderId());
|
||||||
updateWrapper.set(OrderShipDO::getState, OrderShipStateEnum.WAIT_PAYMENT);
|
updateWrapper.set(OrderShipDO::getState, OrderShipStateEnum.WAIT_PAYMENT);
|
||||||
orderShipMapper.update(null, updateWrapper);
|
orderShipMapper.update(null, updateWrapper);
|
||||||
|
|
||||||
// 批量创建经销商应收账款明细
|
|
||||||
createDealerAccountRecords(orderDO);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建经销商应收账款明细
|
* 生成发货单编号
|
||||||
* 在老板审批通过后,根据发货单的应收金额生成应收账款明细
|
|
||||||
*
|
*
|
||||||
* @param orderDO 订单ID
|
* @return 发货单编号
|
||||||
*/
|
*/
|
||||||
private void createDealerAccountRecords(OrderDO orderDO) {
|
private String generateOrderShipSn() {
|
||||||
// 查询该订单的所有发货单
|
// 生成类似 SO20251105001 格式的编号
|
||||||
LambdaQueryWrapper<OrderShipDO> shipQueryWrapper = Wrappers.lambdaQuery(OrderShipDO.class);
|
return java.time.LocalDate.now().format(java.time.format.DateTimeFormatter.BASIC_ISO_DATE)
|
||||||
shipQueryWrapper.eq(OrderShipDO::getOrderId, orderDO.getOrderId());
|
+ String.format("%03d", System.currentTimeMillis() % 1000);
|
||||||
List<OrderShipDO> orderShipDOList = orderShipMapper.selectList(shipQueryWrapper);
|
|
||||||
|
|
||||||
if (CollUtil.isEmpty(orderShipDOList)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 按经销商分组,避免同一经销商的记录重复计算
|
|
||||||
Map<Long, List<OrderShipDO>> dealerShipMap = orderShipDOList.stream()
|
|
||||||
.filter(ship -> ship.getReceivableAmount() != null && ship.getReceivableAmount().compareTo(BigDecimal.ZERO) > 0)
|
|
||||||
.collect(Collectors.groupingBy(OrderShipDO::getDealerId));
|
|
||||||
|
|
||||||
// 为每个经销商创建应收账款明细
|
|
||||||
for (Map.Entry<Long, List<OrderShipDO>> entry : dealerShipMap.entrySet()) {
|
|
||||||
Long dealerId = entry.getKey();
|
|
||||||
List<OrderShipDO> ships = entry.getValue();
|
|
||||||
|
|
||||||
// 计算该经销商的总应收金额
|
|
||||||
BigDecimal totalReceivableAmount = ships.stream()
|
|
||||||
.map(OrderShipDO::getReceivableAmount)
|
|
||||||
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
||||||
|
|
||||||
// 获取经销商当前应收金额(变动前金额)
|
|
||||||
DealerDO dealerDO = dealerMapper.selectById(dealerId);
|
|
||||||
if (dealerDO == null) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
BigDecimal beforeAmount = dealerDO.getReceivable() != null ? dealerDO.getReceivable() : BigDecimal.ZERO;
|
|
||||||
|
|
||||||
// 计算变动后金额
|
|
||||||
BigDecimal afterAmount = beforeAmount.add(totalReceivableAmount);
|
|
||||||
|
|
||||||
// 更新经销商的应收金额
|
|
||||||
dealerDO.setReceivable(afterAmount);
|
|
||||||
dealerMapper.updateById(dealerDO);
|
|
||||||
|
|
||||||
// 为每个发货单创建应收账款明细
|
|
||||||
for (OrderShipDO ship : ships) {
|
|
||||||
// 获取该经销商在该发货单之前的累计金额(之前已处理的发货单)
|
|
||||||
BigDecimal shipBeforeAmount = beforeAmount.add(
|
|
||||||
ships.stream()
|
|
||||||
.filter(s -> s.getOrderShipId().compareTo(ship.getOrderShipId()) < 0)
|
|
||||||
.map(OrderShipDO::getReceivableAmount)
|
|
||||||
.reduce(BigDecimal.ZERO, BigDecimal::add)
|
|
||||||
);
|
|
||||||
|
|
||||||
BigDecimal shipAfterAmount = shipBeforeAmount.add(ship.getReceivableAmount());
|
|
||||||
|
|
||||||
// 创建应收账款明细
|
|
||||||
DealerAccountRecordDO recordDO = new DealerAccountRecordDO();
|
|
||||||
recordDO.setRecordSn("AR" + java.time.LocalDate.now().format(java.time.format.DateTimeFormatter.BASIC_ISO_DATE)
|
|
||||||
+ String.format("%04d", System.currentTimeMillis() % 10000));
|
|
||||||
recordDO.setDealerId(dealerId);
|
|
||||||
recordDO.setOrderId(orderDO.getOrderId());
|
|
||||||
recordDO.setTargetId(ship.getOrderShipId());
|
|
||||||
// 根据 OrderShipTypeEnum 和订单类型设置 targetType
|
|
||||||
recordDO.setTargetType(DealerAccountRecordTargetTypeEnum.fromOrderShipType(ship.getType(), orderDO.getType()));
|
|
||||||
recordDO.setBeforeAmount(shipBeforeAmount);
|
|
||||||
recordDO.setAmount(ship.getReceivableAmount());
|
|
||||||
recordDO.setAfterAmount(shipAfterAmount);
|
|
||||||
recordDO.setRemark("发货单应收账款:" + ship.getOrderSn());
|
|
||||||
|
|
||||||
dealerAccountRecordMapper.insert(recordDO);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -752,7 +680,7 @@ public class OrderGatewayImpl implements OrderGateway {
|
|||||||
if (orderStep1Cmd.getOrderId() == null) {
|
if (orderStep1Cmd.getOrderId() == null) {
|
||||||
orderDO = orderConvert.toOrderDO(orderStep1Cmd);
|
orderDO = orderConvert.toOrderDO(orderStep1Cmd);
|
||||||
orderDO.setState(OrderStateEnum.DRAFT);
|
orderDO.setState(OrderStateEnum.DRAFT);
|
||||||
orderDO.setOrderSn(SerialNumberGenerator.generate("CG"));
|
orderDO.setOrderSn("CG" + generateOrderShipSn());
|
||||||
orderDO.setType(orderStep1Cmd.getType());
|
orderDO.setType(orderStep1Cmd.getType());
|
||||||
orderMapper.insert(orderDO);
|
orderMapper.insert(orderDO);
|
||||||
} else {
|
} else {
|
||||||
@ -774,7 +702,6 @@ public class OrderGatewayImpl implements OrderGateway {
|
|||||||
OrderVehicleDO orderVehicleDO = orderVehicleConvert.toOrderVehicleDO(orderVehicle);
|
OrderVehicleDO orderVehicleDO = orderVehicleConvert.toOrderVehicleDO(orderVehicle);
|
||||||
|
|
||||||
if (orderVehicle.getVehicleId() != null) {
|
if (orderVehicle.getVehicleId() != null) {
|
||||||
orderVehicleDO.setVehicleId(orderVehicle.getVehicleId());
|
|
||||||
orderVehicleMapper.updateById(orderVehicleDO);
|
orderVehicleMapper.updateById(orderVehicleDO);
|
||||||
} else {
|
} else {
|
||||||
// 检查是否已存在车辆信息
|
// 检查是否已存在车辆信息
|
||||||
@ -991,6 +918,15 @@ public class OrderGatewayImpl implements OrderGateway {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生成编码
|
||||||
|
*/
|
||||||
|
private String generateInvoiceSn() {
|
||||||
|
// 生成类似 SO20251105001 格式的编号
|
||||||
|
return java.time.LocalDate.now().format(java.time.format.DateTimeFormatter.BASIC_ISO_DATE)
|
||||||
|
+ String.format("%03d", System.currentTimeMillis() % 1000);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 处理供应商发票信息
|
* 处理供应商发票信息
|
||||||
* 逻辑:
|
* 逻辑:
|
||||||
@ -1031,7 +967,7 @@ public class OrderGatewayImpl implements OrderGateway {
|
|||||||
newInvoice.setInvoiceImg(frontendInvoiceImg);
|
newInvoice.setInvoiceImg(frontendInvoiceImg);
|
||||||
newInvoice.setCreatedBy(orderStep2Cmd.getCreatedBy());
|
newInvoice.setCreatedBy(orderStep2Cmd.getCreatedBy());
|
||||||
newInvoice.setCreatedByName(orderStep2Cmd.getCreatedByName());
|
newInvoice.setCreatedByName(orderStep2Cmd.getCreatedByName());
|
||||||
newInvoice.setInvoiceSn(SerialNumberGenerator.generate("INV"));
|
newInvoice.setInvoiceSn("INV" + generateInvoiceSn());
|
||||||
|
|
||||||
// 构建 orderSupplierInvoice 列表
|
// 构建 orderSupplierInvoice 列表
|
||||||
List<OrderSupplierInvoice> orderSupplierInvoiceList = buildOrderSupplierInvoiceList(supplierDO);
|
List<OrderSupplierInvoice> orderSupplierInvoiceList = buildOrderSupplierInvoiceList(supplierDO);
|
||||||
|
|||||||
@ -61,20 +61,12 @@ public class OrderShipGatewayImpl implements OrderShipGateway {
|
|||||||
public IPage<OrderShip> page(OrderShipPageQry orderShipPageQry) {
|
public IPage<OrderShip> page(OrderShipPageQry orderShipPageQry) {
|
||||||
LambdaQueryWrapper<OrderShipDO> queryWrapper = Wrappers.lambdaQuery(OrderShipDO.class);
|
LambdaQueryWrapper<OrderShipDO> queryWrapper = Wrappers.lambdaQuery(OrderShipDO.class);
|
||||||
queryWrapper.like(StrUtil.isNotBlank(orderShipPageQry.getOrderSn()), OrderShipDO::getOrderSn, orderShipPageQry.getOrderSn());
|
queryWrapper.like(StrUtil.isNotBlank(orderShipPageQry.getOrderSn()), OrderShipDO::getOrderSn, orderShipPageQry.getOrderSn());
|
||||||
queryWrapper.eq(Objects.nonNull(orderShipPageQry.getDealerId()), OrderShipDO::getDealerId, orderShipPageQry.getDealerId());
|
|
||||||
queryWrapper.eq(Objects.nonNull(orderShipPageQry.getState()), OrderShipDO::getState, orderShipPageQry.getState());
|
queryWrapper.eq(Objects.nonNull(orderShipPageQry.getState()), OrderShipDO::getState, orderShipPageQry.getState());
|
||||||
queryWrapper.eq(Objects.nonNull(orderShipPageQry.getCreatedBy()), OrderShipDO::getCreatedBy, orderShipPageQry.getCreatedBy());
|
queryWrapper.eq(Objects.nonNull(orderShipPageQry.getCreatedBy()), OrderShipDO::getCreatedBy, orderShipPageQry.getCreatedBy());
|
||||||
if (CollUtil.isNotEmpty(orderShipPageQry.getShippingDate())) {
|
|
||||||
queryWrapper.ge(OrderShipDO::getShippingDate, orderShipPageQry.getShippingDate().get(0));
|
|
||||||
queryWrapper.le(OrderShipDO::getShippingDate, orderShipPageQry.getShippingDate().get(1));
|
|
||||||
}
|
|
||||||
|
|
||||||
queryWrapper.orderBy("shippingDate".equals(orderShipPageQry.getOrderBy()), orderShipPageQry.getOrderDirection().equals("asc"), OrderShipDO::getShippingDate);
|
|
||||||
queryWrapper.orderByDesc(OrderShipDO::getCreatedAt);
|
queryWrapper.orderByDesc(OrderShipDO::getCreatedAt);
|
||||||
|
|
||||||
IPage<OrderShipDO> page = new Page<>(orderShipPageQry.getPageIndex(), orderShipPageQry.getPageSize());
|
IPage<OrderShipDO> page = new Page<>(orderShipPageQry.getPageIndex(), orderShipPageQry.getPageSize());
|
||||||
|
|
||||||
|
|
||||||
page = orderShipMapper.selectPage(page, queryWrapper);
|
page = orderShipMapper.selectPage(page, queryWrapper);
|
||||||
|
|
||||||
Set<Long> orderIdList = page.getRecords().stream().map(OrderShipDO::getOrderId).collect(Collectors.toSet());
|
Set<Long> orderIdList = page.getRecords().stream().map(OrderShipDO::getOrderId).collect(Collectors.toSet());
|
||||||
|
|||||||
@ -24,7 +24,6 @@ import com.xunhong.erp.turbo.biz.infrastructure.convert.PaymentTaskConvert;
|
|||||||
import com.xunhong.erp.turbo.biz.infrastructure.convert.PaymentTaskSupplierConvert;
|
import com.xunhong.erp.turbo.biz.infrastructure.convert.PaymentTaskSupplierConvert;
|
||||||
import com.xunhong.erp.turbo.biz.infrastructure.entity.*;
|
import com.xunhong.erp.turbo.biz.infrastructure.entity.*;
|
||||||
import com.xunhong.erp.turbo.biz.infrastructure.mapper.*;
|
import com.xunhong.erp.turbo.biz.infrastructure.mapper.*;
|
||||||
import com.xunhong.erp.turbo.biz.util.SerialNumberGenerator;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.apache.ibatis.session.ExecutorType;
|
import org.apache.ibatis.session.ExecutorType;
|
||||||
import org.apache.ibatis.session.SqlSession;
|
import org.apache.ibatis.session.SqlSession;
|
||||||
@ -61,11 +60,22 @@ public class PaymentTaskGatewayImpl implements PaymentTaskGateway {
|
|||||||
|
|
||||||
private final PaymentRecordMapper paymentRecordMapper;
|
private final PaymentRecordMapper paymentRecordMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 付款任务编号
|
||||||
|
*
|
||||||
|
* @return 付款任务编号
|
||||||
|
*/
|
||||||
|
private String generatePaymentTaskSn() {
|
||||||
|
// 生成类似 SO20251105001 格式的编号
|
||||||
|
return java.time.LocalDate.now().format(java.time.format.DateTimeFormatter.BASIC_ISO_DATE)
|
||||||
|
+ String.format("%03d", System.currentTimeMillis() % 1000);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional
|
@Transactional
|
||||||
public PaymentTask save(PaymentTaskCreateCmd paymentTaskCreateCmd) {
|
public PaymentTask save(PaymentTaskCreateCmd paymentTaskCreateCmd) {
|
||||||
PaymentTaskDO paymentTaskDO = paymentTaskConvert.toPaymentTaskDO(paymentTaskCreateCmd);
|
PaymentTaskDO paymentTaskDO = paymentTaskConvert.toPaymentTaskDO(paymentTaskCreateCmd);
|
||||||
paymentTaskDO.setPaymentTaskSn(SerialNumberGenerator.generate("TASK"));
|
paymentTaskDO.setPaymentTaskSn("TASK" + generatePaymentTaskSn());
|
||||||
paymentTaskMapper.insert(paymentTaskDO);
|
paymentTaskMapper.insert(paymentTaskDO);
|
||||||
|
|
||||||
SqlSession sqlSession = sqlSessionFactory.openSession(ExecutorType.BATCH, false);
|
SqlSession sqlSession = sqlSessionFactory.openSession(ExecutorType.BATCH, false);
|
||||||
@ -229,7 +239,7 @@ public class PaymentTaskGatewayImpl implements PaymentTaskGateway {
|
|||||||
|
|
||||||
// 创建付款记录
|
// 创建付款记录
|
||||||
PaymentRecordDO paymentRecordDO = new PaymentRecordDO();
|
PaymentRecordDO paymentRecordDO = new PaymentRecordDO();
|
||||||
paymentRecordDO.setPaymentRecordSn(SerialNumberGenerator.generate("PAY"));
|
paymentRecordDO.setPaymentRecordSn(paymentRecordDO.generatePaymentRecordSn());
|
||||||
paymentRecordDO.setPaymentTaskId(paymentTaskPayCmd.getPaymentTaskId());
|
paymentRecordDO.setPaymentTaskId(paymentTaskPayCmd.getPaymentTaskId());
|
||||||
paymentRecordDO.setTargetId(paymentTaskDO.getTargetId());
|
paymentRecordDO.setTargetId(paymentTaskDO.getTargetId());
|
||||||
paymentRecordDO.setTargetType(paymentTaskDO.getTaskType().equals(PaymentTaskTypeEnum.MELON_FARMER)
|
paymentRecordDO.setTargetType(paymentTaskDO.getTaskType().equals(PaymentTaskTypeEnum.MELON_FARMER)
|
||||||
|
|||||||
@ -1,188 +0,0 @@
|
|||||||
package com.xunhong.erp.turbo.biz.infrastructure.gateway;
|
|
||||||
|
|
||||||
import cn.hutool.core.collection.CollUtil;
|
|
||||||
import cn.hutool.core.util.StrUtil;
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
||||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.cmd.ReconciliationCompleteCmd;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.cmd.ReconciliationCreateCmd;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.cmd.ReconciliationDestroyCmd;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.cmd.ReconciliationUpdateCmd;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.enums.ReconciliationStateEnum;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.qry.ReconciliationListQry;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.qry.ReconciliationPageQry;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.qry.ReconciliationShowQry;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.exception.BizErrorCode;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.exception.BizException;
|
|
||||||
import com.xunhong.erp.turbo.biz.domain.entity.Reconciliation;
|
|
||||||
import com.xunhong.erp.turbo.biz.domain.gateway.ReconciliationGateway;
|
|
||||||
import com.xunhong.erp.turbo.biz.infrastructure.convert.ReconciliationConvert;
|
|
||||||
import com.xunhong.erp.turbo.biz.infrastructure.convert.ReconciliationItemConvert;
|
|
||||||
import com.xunhong.erp.turbo.biz.infrastructure.entity.*;
|
|
||||||
import com.xunhong.erp.turbo.biz.infrastructure.mapper.*;
|
|
||||||
import com.xunhong.erp.turbo.biz.util.SerialNumberGenerator;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
import org.apache.ibatis.session.ExecutorType;
|
|
||||||
import org.apache.ibatis.session.SqlSession;
|
|
||||||
import org.apache.ibatis.session.SqlSessionFactory;
|
|
||||||
import org.springframework.stereotype.Repository;
|
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.Objects;
|
|
||||||
import java.util.Set;
|
|
||||||
import java.util.function.Function;
|
|
||||||
import java.util.stream.Collectors;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author shenyifei
|
|
||||||
*/
|
|
||||||
@Repository
|
|
||||||
@RequiredArgsConstructor
|
|
||||||
public class ReconciliationGatewayImpl implements ReconciliationGateway {
|
|
||||||
private final ReconciliationMapper reconciliationMapper;
|
|
||||||
private final ReconciliationConvert reconciliationConvert;
|
|
||||||
|
|
||||||
private final ReconciliationItemConvert reconciliationItemConvert;
|
|
||||||
private final SqlSessionFactory sqlSessionFactory;
|
|
||||||
|
|
||||||
private final ReconciliationItemMapper reconciliationItemMapper;
|
|
||||||
private final OrderShipMapper orderShipMapper;
|
|
||||||
|
|
||||||
private final OrderMapper orderMapper;
|
|
||||||
|
|
||||||
private final CompanyMapper companyMapper;
|
|
||||||
private final DealerMapper dealerMapper;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
@Transactional
|
|
||||||
public Reconciliation save(ReconciliationCreateCmd reconciliationCreateCmd) {
|
|
||||||
ReconciliationDO reconciliationDO = reconciliationConvert.toReconciliationDO(reconciliationCreateCmd);
|
|
||||||
reconciliationDO.setReconciliationSn(SerialNumberGenerator.generate("DZ"));
|
|
||||||
reconciliationDO.setState(ReconciliationStateEnum.PENDING);
|
|
||||||
|
|
||||||
reconciliationMapper.insert(reconciliationDO);
|
|
||||||
|
|
||||||
List<ReconciliationItemDO> reconciliationItemList = reconciliationItemConvert.toReconciliationItemList(reconciliationCreateCmd.getOrderShipVOList());
|
|
||||||
|
|
||||||
SqlSession sqlSession = sqlSessionFactory.openSession(ExecutorType.BATCH, false);
|
|
||||||
ReconciliationItemMapper reconciliationItemMapper = sqlSession.getMapper(ReconciliationItemMapper.class);
|
|
||||||
reconciliationItemList.forEach(reconciliationItemDO -> {
|
|
||||||
reconciliationItemDO.setReconciliationId(reconciliationDO.getReconciliationId());
|
|
||||||
reconciliationItemMapper.insert(reconciliationItemDO);
|
|
||||||
});
|
|
||||||
|
|
||||||
sqlSession.commit();
|
|
||||||
sqlSession.close();
|
|
||||||
return reconciliationConvert.toReconciliation(reconciliationDO);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public IPage<Reconciliation> page(ReconciliationPageQry reconciliationPageQry) {
|
|
||||||
LambdaQueryWrapper<ReconciliationDO> queryWrapper = Wrappers.lambdaQuery(ReconciliationDO.class);
|
|
||||||
queryWrapper.eq(Objects.nonNull(reconciliationPageQry.getDealerId()), ReconciliationDO::getDealerId, reconciliationPageQry.getDealerId());
|
|
||||||
queryWrapper.eq(Objects.nonNull(reconciliationPageQry.getState()), ReconciliationDO::getState, reconciliationPageQry.getState());
|
|
||||||
queryWrapper.like(StrUtil.isNotBlank(reconciliationPageQry.getReconciliationSn()), ReconciliationDO::getReconciliationSn, reconciliationPageQry.getReconciliationSn());
|
|
||||||
queryWrapper.orderByDesc(ReconciliationDO::getCreatedAt);
|
|
||||||
|
|
||||||
IPage<ReconciliationDO> page = new Page<>(reconciliationPageQry.getPageIndex(), reconciliationPageQry.getPageSize());
|
|
||||||
page = reconciliationMapper.selectPage(page, queryWrapper, reconciliationPageQry);
|
|
||||||
Set<Long> reconciliationIdList = page.getRecords().stream().map(ReconciliationDO::getReconciliationId).collect(Collectors.toSet());
|
|
||||||
if (CollUtil.isNotEmpty(reconciliationIdList)) {
|
|
||||||
List<OrderDO> orderDOList = orderMapper.selectByReconciliationIdList(reconciliationIdList);
|
|
||||||
Map<Long, OrderDO> orderDOMap = orderDOList.stream().collect(Collectors.toMap(OrderDO::getOrderId, Function.identity()));
|
|
||||||
List<OrderShipDO> orderShipDOList = orderShipMapper.selectByReconciliationIdList(reconciliationIdList);
|
|
||||||
orderShipDOList.forEach(orderShipDO -> {
|
|
||||||
orderShipDO.setOrderDO(orderDOMap.get(orderShipDO.getOrderId()));
|
|
||||||
});
|
|
||||||
|
|
||||||
page.getRecords().forEach(reconciliationDO -> {
|
|
||||||
reconciliationDO.setOrderShipDOList(orderShipDOList.stream().filter(orderShipDO -> orderShipDO.getReconciliationId().equals(reconciliationDO.getReconciliationId())).toList());
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
Set<Long> companyIdList = page.getRecords().stream().map(ReconciliationDO::getCompanyId).collect(Collectors.toSet());
|
|
||||||
if (CollUtil.isNotEmpty(companyIdList)) {
|
|
||||||
List<CompanyDO> companyDOList = companyMapper.selectByIds(companyIdList);
|
|
||||||
Map<Long, CompanyDO> companyDOMap = companyDOList.stream().collect(Collectors.toMap(CompanyDO::getCompanyId, Function.identity()));
|
|
||||||
page.getRecords().forEach(reconciliationDO -> {
|
|
||||||
reconciliationDO.setCompanyDO(companyDOMap.get(reconciliationDO.getCompanyId()));
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
Set<Long> dealerIdList = page.getRecords().stream().map(ReconciliationDO::getDealerId).collect(Collectors.toSet());
|
|
||||||
if (CollUtil.isNotEmpty(dealerIdList)) {
|
|
||||||
List<DealerDO> dealerDOList = dealerMapper.selectByIds(dealerIdList);
|
|
||||||
Map<Long, DealerDO> dealerDOMap = dealerDOList.stream().collect(Collectors.toMap(DealerDO::getDealerId, Function.identity()));
|
|
||||||
page.getRecords().forEach(reconciliationDO -> {
|
|
||||||
reconciliationDO.setDealerDO(dealerDOMap.get(reconciliationDO.getDealerId()));
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
return page.convert(reconciliationConvert::toReconciliation);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<Reconciliation> list(ReconciliationListQry reconciliationListQry) {
|
|
||||||
LambdaQueryWrapper<ReconciliationDO> queryWrapper = Wrappers.lambdaQuery(ReconciliationDO.class);
|
|
||||||
List<ReconciliationDO> reconciliationDOList = reconciliationMapper.selectList(queryWrapper);
|
|
||||||
return reconciliationDOList.stream().map(reconciliationConvert::toReconciliation).toList();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Reconciliation update(ReconciliationUpdateCmd reconciliationUpdateCmd) {
|
|
||||||
LambdaQueryWrapper<ReconciliationDO> queryWrapper = Wrappers.lambdaQuery(ReconciliationDO.class);
|
|
||||||
queryWrapper.eq(ReconciliationDO::getReconciliationId, reconciliationUpdateCmd.getReconciliationId());
|
|
||||||
queryWrapper.last("limit 1");
|
|
||||||
|
|
||||||
ReconciliationDO reconciliationDO = reconciliationMapper.selectOne(queryWrapper);
|
|
||||||
|
|
||||||
reconciliationConvert.toReconciliationDO(reconciliationDO, reconciliationUpdateCmd);
|
|
||||||
reconciliationMapper.updateById(reconciliationDO);
|
|
||||||
|
|
||||||
return reconciliationConvert.toReconciliation(reconciliationDO);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Reconciliation show(ReconciliationShowQry reconciliationShowQry) {
|
|
||||||
LambdaQueryWrapper<ReconciliationDO> queryWrapper = Wrappers.lambdaQuery(ReconciliationDO.class);
|
|
||||||
queryWrapper.eq(ReconciliationDO::getReconciliationId, reconciliationShowQry.getReconciliationId());
|
|
||||||
queryWrapper.last("limit 1");
|
|
||||||
|
|
||||||
ReconciliationDO reconciliationDO = reconciliationMapper.selectOne(queryWrapper);
|
|
||||||
return reconciliationConvert.toReconciliation(reconciliationDO);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Reconciliation complete(ReconciliationCompleteCmd reconciliationCompleteCmd) {
|
|
||||||
LambdaQueryWrapper<ReconciliationDO> queryWrapper = Wrappers.lambdaQuery(ReconciliationDO.class);
|
|
||||||
queryWrapper.eq(ReconciliationDO::getReconciliationId, reconciliationCompleteCmd.getReconciliationId());
|
|
||||||
queryWrapper.select(ReconciliationDO::getReconciliationId, ReconciliationDO::getState);
|
|
||||||
queryWrapper.last("limit 1");
|
|
||||||
|
|
||||||
ReconciliationDO reconciliationDO = reconciliationMapper.selectOne(queryWrapper);
|
|
||||||
|
|
||||||
if (!reconciliationDO.getState().equals(ReconciliationStateEnum.PENDING)) {
|
|
||||||
throw new BizException(BizErrorCode.B_BIZ_RECONCILIATION_NOT_PENDING);
|
|
||||||
}
|
|
||||||
|
|
||||||
reconciliationDO.setState(ReconciliationStateEnum.RECONCILED);
|
|
||||||
reconciliationMapper.updateById(reconciliationDO);
|
|
||||||
|
|
||||||
return reconciliationConvert.toReconciliation(reconciliationDO);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void destroy(ReconciliationDestroyCmd reconciliationDestroyCmd) {
|
|
||||||
LambdaQueryWrapper<ReconciliationDO> queryWrapper = Wrappers.lambdaQuery(ReconciliationDO.class);
|
|
||||||
queryWrapper.eq(ReconciliationDO::getReconciliationId, reconciliationDestroyCmd.getReconciliationId());
|
|
||||||
queryWrapper.last("limit 1");
|
|
||||||
|
|
||||||
ReconciliationDO reconciliationDO = reconciliationMapper.selectOne(queryWrapper);
|
|
||||||
reconciliationDO.deleteById();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@ -1,141 +0,0 @@
|
|||||||
package com.xunhong.erp.turbo.biz.infrastructure.gateway;
|
|
||||||
|
|
||||||
import cn.hutool.core.collection.CollUtil;
|
|
||||||
import cn.hutool.core.util.StrUtil;
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
||||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.cmd.ReconciliationInvoiceCreateCmd;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.cmd.ReconciliationInvoiceDestroyCmd;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.cmd.ReconciliationInvoiceUpdateCmd;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.qry.ReconciliationInvoiceListQry;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.qry.ReconciliationInvoicePageQry;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.qry.ReconciliationInvoiceShowQry;
|
|
||||||
import com.xunhong.erp.turbo.biz.domain.entity.ReconciliationInvoice;
|
|
||||||
import com.xunhong.erp.turbo.biz.domain.gateway.ReconciliationInvoiceGateway;
|
|
||||||
import com.xunhong.erp.turbo.biz.infrastructure.convert.ReconciliationInvoiceConvert;
|
|
||||||
import com.xunhong.erp.turbo.biz.infrastructure.entity.CompanyDO;
|
|
||||||
import com.xunhong.erp.turbo.biz.infrastructure.entity.DealerDO;
|
|
||||||
import com.xunhong.erp.turbo.biz.infrastructure.entity.DealerPaymentAccountDO;
|
|
||||||
import com.xunhong.erp.turbo.biz.infrastructure.entity.ReconciliationInvoiceDO;
|
|
||||||
import com.xunhong.erp.turbo.biz.infrastructure.mapper.CompanyMapper;
|
|
||||||
import com.xunhong.erp.turbo.biz.infrastructure.mapper.DealerMapper;
|
|
||||||
import com.xunhong.erp.turbo.biz.infrastructure.mapper.DealerPaymentAccountMapper;
|
|
||||||
import com.xunhong.erp.turbo.biz.infrastructure.mapper.ReconciliationInvoiceMapper;
|
|
||||||
import com.xunhong.erp.turbo.biz.util.SerialNumberGenerator;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
import org.springframework.stereotype.Repository;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.Objects;
|
|
||||||
import java.util.Set;
|
|
||||||
import java.util.function.Function;
|
|
||||||
import java.util.stream.Collectors;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author shenyifei
|
|
||||||
*/
|
|
||||||
@Repository
|
|
||||||
@RequiredArgsConstructor
|
|
||||||
public class ReconciliationInvoiceGatewayImpl implements ReconciliationInvoiceGateway {
|
|
||||||
private final ReconciliationInvoiceMapper reconciliationInvoiceMapper;
|
|
||||||
private final ReconciliationInvoiceConvert reconciliationInvoiceConvert;
|
|
||||||
|
|
||||||
private final DealerMapper dealerMapper;
|
|
||||||
private final CompanyMapper companyMapper;
|
|
||||||
private final DealerPaymentAccountMapper dealerPaymentAccountMapper;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public ReconciliationInvoice save(ReconciliationInvoiceCreateCmd reconciliationInvoiceCreateCmd) {
|
|
||||||
ReconciliationInvoiceDO reconciliationInvoiceDO = reconciliationInvoiceConvert.toReconciliationInvoiceDO(reconciliationInvoiceCreateCmd);
|
|
||||||
reconciliationInvoiceDO.setInvoiceSn(SerialNumberGenerator.generate("INV"));
|
|
||||||
reconciliationInvoiceMapper.insert(reconciliationInvoiceDO);
|
|
||||||
|
|
||||||
return reconciliationInvoiceConvert.toReconciliationInvoice(reconciliationInvoiceDO);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public IPage<ReconciliationInvoice> page(ReconciliationInvoicePageQry reconciliationInvoicePageQry) {
|
|
||||||
LambdaQueryWrapper<ReconciliationInvoiceDO> queryWrapper = Wrappers.lambdaQuery(ReconciliationInvoiceDO.class);
|
|
||||||
queryWrapper.eq(Objects.nonNull(reconciliationInvoicePageQry.getReconciliationId()), ReconciliationInvoiceDO::getReconciliationId, reconciliationInvoicePageQry.getReconciliationId());
|
|
||||||
queryWrapper.like(StrUtil.isNotBlank(reconciliationInvoicePageQry.getInvoiceSn()), ReconciliationInvoiceDO::getInvoiceSn, reconciliationInvoicePageQry.getInvoiceSn());
|
|
||||||
queryWrapper.eq(Objects.nonNull(reconciliationInvoicePageQry.getCompanyId()), ReconciliationInvoiceDO::getCompanyId, reconciliationInvoicePageQry.getCompanyId());
|
|
||||||
queryWrapper.eq(Objects.nonNull(reconciliationInvoicePageQry.getDealerId()), ReconciliationInvoiceDO::getDealerId, reconciliationInvoicePageQry.getDealerId());
|
|
||||||
|
|
||||||
if (CollUtil.isNotEmpty(reconciliationInvoicePageQry.getInvoiceDate())) {
|
|
||||||
queryWrapper.between(ReconciliationInvoiceDO::getInvoiceDate, reconciliationInvoicePageQry.getInvoiceDate().get(0), reconciliationInvoicePageQry.getInvoiceDate().get(1));
|
|
||||||
}
|
|
||||||
|
|
||||||
queryWrapper.orderByDesc(ReconciliationInvoiceDO::getCreatedAt);
|
|
||||||
|
|
||||||
IPage<ReconciliationInvoiceDO> page = new Page<>(reconciliationInvoicePageQry.getPageIndex(), reconciliationInvoicePageQry.getPageSize());
|
|
||||||
page = reconciliationInvoiceMapper.selectPage(page, queryWrapper);
|
|
||||||
|
|
||||||
Set<Long> dealerIdList = page.getRecords().stream().map(ReconciliationInvoiceDO::getDealerId).collect(Collectors.toSet());
|
|
||||||
if (CollUtil.isNotEmpty(dealerIdList)) {
|
|
||||||
List<DealerDO> dealerDOList = dealerMapper.selectByIds(dealerIdList);
|
|
||||||
Map<Long, DealerDO> dealerDOMap = dealerDOList.stream().collect(Collectors.toMap(DealerDO::getDealerId, Function.identity()));
|
|
||||||
page.getRecords().forEach(reconciliationInvoiceDO -> reconciliationInvoiceDO.setDealerDO(dealerDOMap.get(reconciliationInvoiceDO.getDealerId())));
|
|
||||||
}
|
|
||||||
|
|
||||||
Set<Long> companyIdList = page.getRecords().stream().map(ReconciliationInvoiceDO::getCompanyId).collect(Collectors.toSet());
|
|
||||||
if (CollUtil.isNotEmpty(companyIdList)) {
|
|
||||||
List<CompanyDO> companyDOList = companyMapper.selectByIds(companyIdList);
|
|
||||||
Map<Long, CompanyDO> companyDOMap = companyDOList.stream().collect(Collectors.toMap(CompanyDO::getCompanyId, Function.identity()));
|
|
||||||
page.getRecords().forEach(reconciliationInvoiceDO -> reconciliationInvoiceDO.setCompanyDO(companyDOMap.get(reconciliationInvoiceDO.getCompanyId())));
|
|
||||||
}
|
|
||||||
|
|
||||||
Set<Long> dealerPaymentAccountIdList = page.getRecords().stream().map(ReconciliationInvoiceDO::getAccountId).collect(Collectors.toSet());
|
|
||||||
if (CollUtil.isNotEmpty(dealerPaymentAccountIdList)) {
|
|
||||||
List<DealerPaymentAccountDO> dealerPaymentAccountDOList = dealerPaymentAccountMapper.selectByIds(dealerPaymentAccountIdList);
|
|
||||||
Map<Long, DealerPaymentAccountDO> dealerPaymentAccountDOMap = dealerPaymentAccountDOList.stream().collect(Collectors.toMap(DealerPaymentAccountDO::getAccountId, Function.identity()));
|
|
||||||
page.getRecords().forEach(reconciliationInvoiceDO -> reconciliationInvoiceDO.setDealerPaymentAccountDO(dealerPaymentAccountDOMap.get(reconciliationInvoiceDO.getAccountId())));
|
|
||||||
}
|
|
||||||
|
|
||||||
return page.convert(reconciliationInvoiceConvert::toReconciliationInvoice);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<ReconciliationInvoice> list(ReconciliationInvoiceListQry reconciliationInvoiceListQry) {
|
|
||||||
LambdaQueryWrapper<ReconciliationInvoiceDO> queryWrapper = Wrappers.lambdaQuery(ReconciliationInvoiceDO.class);
|
|
||||||
List<ReconciliationInvoiceDO> reconciliationInvoiceDOList = reconciliationInvoiceMapper.selectList(queryWrapper);
|
|
||||||
return reconciliationInvoiceDOList.stream().map(reconciliationInvoiceConvert::toReconciliationInvoice).toList();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public ReconciliationInvoice update(ReconciliationInvoiceUpdateCmd reconciliationInvoiceUpdateCmd) {
|
|
||||||
LambdaQueryWrapper<ReconciliationInvoiceDO> queryWrapper = Wrappers.lambdaQuery(ReconciliationInvoiceDO.class);
|
|
||||||
queryWrapper.eq(ReconciliationInvoiceDO::getReconciliationInvoiceId, reconciliationInvoiceUpdateCmd.getReconciliationInvoiceId());
|
|
||||||
queryWrapper.last("limit 1");
|
|
||||||
|
|
||||||
ReconciliationInvoiceDO reconciliationInvoiceDO = reconciliationInvoiceMapper.selectOne(queryWrapper);
|
|
||||||
|
|
||||||
reconciliationInvoiceConvert.toReconciliationInvoiceDO(reconciliationInvoiceDO, reconciliationInvoiceUpdateCmd);
|
|
||||||
reconciliationInvoiceMapper.updateById(reconciliationInvoiceDO);
|
|
||||||
|
|
||||||
return reconciliationInvoiceConvert.toReconciliationInvoice(reconciliationInvoiceDO);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public ReconciliationInvoice show(ReconciliationInvoiceShowQry reconciliationInvoiceShowQry) {
|
|
||||||
LambdaQueryWrapper<ReconciliationInvoiceDO> queryWrapper = Wrappers.lambdaQuery(ReconciliationInvoiceDO.class);
|
|
||||||
queryWrapper.eq(ReconciliationInvoiceDO::getReconciliationInvoiceId, reconciliationInvoiceShowQry.getReconciliationInvoiceId());
|
|
||||||
queryWrapper.last("limit 1");
|
|
||||||
|
|
||||||
ReconciliationInvoiceDO reconciliationInvoiceDO = reconciliationInvoiceMapper.selectOne(queryWrapper);
|
|
||||||
return reconciliationInvoiceConvert.toReconciliationInvoice(reconciliationInvoiceDO);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void destroy(ReconciliationInvoiceDestroyCmd reconciliationInvoiceDestroyCmd) {
|
|
||||||
LambdaQueryWrapper<ReconciliationInvoiceDO> queryWrapper = Wrappers.lambdaQuery(ReconciliationInvoiceDO.class);
|
|
||||||
queryWrapper.eq(ReconciliationInvoiceDO::getReconciliationInvoiceId, reconciliationInvoiceDestroyCmd.getReconciliationInvoiceId());
|
|
||||||
queryWrapper.last("limit 1");
|
|
||||||
|
|
||||||
ReconciliationInvoiceDO reconciliationInvoiceDO = reconciliationInvoiceMapper.selectOne(queryWrapper);
|
|
||||||
reconciliationInvoiceDO.deleteById();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@ -1,92 +0,0 @@
|
|||||||
package com.xunhong.erp.turbo.biz.infrastructure.gateway;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
||||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.cmd.ReconciliationPaymentCreateCmd;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.cmd.ReconciliationPaymentDestroyCmd;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.cmd.ReconciliationPaymentUpdateCmd;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.qry.ReconciliationPaymentListQry;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.qry.ReconciliationPaymentPageQry;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.qry.ReconciliationPaymentShowQry;
|
|
||||||
import com.xunhong.erp.turbo.biz.domain.entity.ReconciliationPayment;
|
|
||||||
import com.xunhong.erp.turbo.biz.domain.gateway.ReconciliationPaymentGateway;
|
|
||||||
import com.xunhong.erp.turbo.biz.infrastructure.convert.ReconciliationPaymentConvert;
|
|
||||||
import com.xunhong.erp.turbo.biz.infrastructure.entity.ReconciliationPaymentDO;
|
|
||||||
import com.xunhong.erp.turbo.biz.infrastructure.mapper.ReconciliationPaymentMapper;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
import org.springframework.stereotype.Repository;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author shenyifei
|
|
||||||
*/
|
|
||||||
@Repository
|
|
||||||
@RequiredArgsConstructor
|
|
||||||
public class ReconciliationPaymentGatewayImpl implements ReconciliationPaymentGateway {
|
|
||||||
private final ReconciliationPaymentMapper reconciliationPaymentMapper;
|
|
||||||
private final ReconciliationPaymentConvert reconciliationPaymentConvert;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public ReconciliationPayment save(ReconciliationPaymentCreateCmd reconciliationPaymentCreateCmd) {
|
|
||||||
ReconciliationPaymentDO reconciliationPaymentDO = reconciliationPaymentConvert.toReconciliationPaymentDO(reconciliationPaymentCreateCmd);
|
|
||||||
reconciliationPaymentMapper.insert(reconciliationPaymentDO);
|
|
||||||
|
|
||||||
return reconciliationPaymentConvert.toReconciliationPayment(reconciliationPaymentDO);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public IPage<ReconciliationPayment> page(ReconciliationPaymentPageQry reconciliationPaymentPageQry) {
|
|
||||||
LambdaQueryWrapper<ReconciliationPaymentDO> queryWrapper = Wrappers.lambdaQuery(ReconciliationPaymentDO.class);
|
|
||||||
queryWrapper.orderByDesc(ReconciliationPaymentDO::getCreatedAt);
|
|
||||||
|
|
||||||
IPage<ReconciliationPaymentDO> page = new Page<>(reconciliationPaymentPageQry.getPageIndex(), reconciliationPaymentPageQry.getPageSize());
|
|
||||||
page = reconciliationPaymentMapper.selectPage(page, queryWrapper);
|
|
||||||
|
|
||||||
return page.convert(reconciliationPaymentConvert::toReconciliationPayment);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<ReconciliationPayment> list(ReconciliationPaymentListQry reconciliationPaymentListQry) {
|
|
||||||
LambdaQueryWrapper<ReconciliationPaymentDO> queryWrapper = Wrappers.lambdaQuery(ReconciliationPaymentDO.class);
|
|
||||||
List<ReconciliationPaymentDO> reconciliationPaymentDOList = reconciliationPaymentMapper.selectList(queryWrapper);
|
|
||||||
return reconciliationPaymentDOList.stream().map(reconciliationPaymentConvert::toReconciliationPayment).toList();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public ReconciliationPayment update(ReconciliationPaymentUpdateCmd reconciliationPaymentUpdateCmd) {
|
|
||||||
LambdaQueryWrapper<ReconciliationPaymentDO> queryWrapper = Wrappers.lambdaQuery(ReconciliationPaymentDO.class);
|
|
||||||
queryWrapper.eq(ReconciliationPaymentDO::getReconciliationPaymentId, reconciliationPaymentUpdateCmd.getReconciliationPaymentId());
|
|
||||||
queryWrapper.last("limit 1");
|
|
||||||
|
|
||||||
ReconciliationPaymentDO reconciliationPaymentDO = reconciliationPaymentMapper.selectOne(queryWrapper);
|
|
||||||
|
|
||||||
reconciliationPaymentConvert.toReconciliationPaymentDO(reconciliationPaymentDO, reconciliationPaymentUpdateCmd);
|
|
||||||
reconciliationPaymentMapper.updateById(reconciliationPaymentDO);
|
|
||||||
|
|
||||||
return reconciliationPaymentConvert.toReconciliationPayment(reconciliationPaymentDO);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public ReconciliationPayment show(ReconciliationPaymentShowQry reconciliationPaymentShowQry) {
|
|
||||||
LambdaQueryWrapper<ReconciliationPaymentDO> queryWrapper = Wrappers.lambdaQuery(ReconciliationPaymentDO.class);
|
|
||||||
queryWrapper.eq(ReconciliationPaymentDO::getReconciliationPaymentId, reconciliationPaymentShowQry.getReconciliationPaymentId());
|
|
||||||
queryWrapper.last("limit 1");
|
|
||||||
|
|
||||||
ReconciliationPaymentDO reconciliationPaymentDO = reconciliationPaymentMapper.selectOne(queryWrapper);
|
|
||||||
return reconciliationPaymentConvert.toReconciliationPayment(reconciliationPaymentDO);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void destroy(ReconciliationPaymentDestroyCmd reconciliationPaymentDestroyCmd) {
|
|
||||||
LambdaQueryWrapper<ReconciliationPaymentDO> queryWrapper = Wrappers.lambdaQuery(ReconciliationPaymentDO.class);
|
|
||||||
queryWrapper.eq(ReconciliationPaymentDO::getReconciliationPaymentId, reconciliationPaymentDestroyCmd.getReconciliationPaymentId());
|
|
||||||
queryWrapper.last("limit 1");
|
|
||||||
|
|
||||||
ReconciliationPaymentDO reconciliationPaymentDO = reconciliationPaymentMapper.selectOne(queryWrapper);
|
|
||||||
reconciliationPaymentDO.deleteById();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@ -20,7 +20,6 @@ import com.xunhong.erp.turbo.biz.infrastructure.entity.OrderSupplierDO;
|
|||||||
import com.xunhong.erp.turbo.biz.infrastructure.entity.SupplierInvoiceDO;
|
import com.xunhong.erp.turbo.biz.infrastructure.entity.SupplierInvoiceDO;
|
||||||
import com.xunhong.erp.turbo.biz.infrastructure.mapper.OrderSupplierMapper;
|
import com.xunhong.erp.turbo.biz.infrastructure.mapper.OrderSupplierMapper;
|
||||||
import com.xunhong.erp.turbo.biz.infrastructure.mapper.SupplierInvoiceMapper;
|
import com.xunhong.erp.turbo.biz.infrastructure.mapper.SupplierInvoiceMapper;
|
||||||
import com.xunhong.erp.turbo.biz.util.SerialNumberGenerator;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.stereotype.Repository;
|
import org.springframework.stereotype.Repository;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
@ -39,11 +38,20 @@ public class SupplierInvoiceGatewayImpl implements SupplierInvoiceGateway {
|
|||||||
|
|
||||||
private final OrderSupplierMapper orderSupplierMapper;
|
private final OrderSupplierMapper orderSupplierMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生成编码
|
||||||
|
*/
|
||||||
|
private String generateInvoiceSn() {
|
||||||
|
// 生成类似 SO20251105001 格式的编号
|
||||||
|
return java.time.LocalDate.now().format(java.time.format.DateTimeFormatter.BASIC_ISO_DATE)
|
||||||
|
+ String.format("%03d", System.currentTimeMillis() % 1000);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional
|
@Transactional
|
||||||
public SupplierInvoice save(SupplierInvoiceCreateCmd supplierInvoiceCreateCmd) {
|
public SupplierInvoice save(SupplierInvoiceCreateCmd supplierInvoiceCreateCmd) {
|
||||||
SupplierInvoiceDO supplierInvoiceDO = supplierInvoiceConvert.toInvoiceDO(supplierInvoiceCreateCmd);
|
SupplierInvoiceDO supplierInvoiceDO = supplierInvoiceConvert.toInvoiceDO(supplierInvoiceCreateCmd);
|
||||||
supplierInvoiceDO.setInvoiceSn(SerialNumberGenerator.generate("INV"));
|
supplierInvoiceDO.setInvoiceSn("INV" + generateInvoiceSn());
|
||||||
supplierInvoiceMapper.insert(supplierInvoiceDO);
|
supplierInvoiceMapper.insert(supplierInvoiceDO);
|
||||||
|
|
||||||
List<Long> orderSupplierIdList = supplierInvoiceCreateCmd.getOrderSupplierInvoiceList().stream().map(OrderSupplierInvoice::getOrderSupplierId).toList();
|
List<Long> orderSupplierIdList = supplierInvoiceCreateCmd.getOrderSupplierInvoiceList().stream().map(OrderSupplierInvoice::getOrderSupplierId).toList();
|
||||||
|
|||||||
@ -1,13 +0,0 @@
|
|||||||
package com.xunhong.erp.turbo.biz.infrastructure.mapper;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|
||||||
import com.xunhong.erp.turbo.biz.infrastructure.entity.DealerAccountRecordDO;
|
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author shenyifei
|
|
||||||
*/
|
|
||||||
@Mapper
|
|
||||||
public interface DealerAccountRecordMapper extends BaseMapper<DealerAccountRecordDO> {
|
|
||||||
}
|
|
||||||
|
|
||||||
@ -20,13 +20,10 @@ import java.util.Set;
|
|||||||
public interface OrderMapper extends BaseMapper<OrderDO> {
|
public interface OrderMapper extends BaseMapper<OrderDO> {
|
||||||
|
|
||||||
List<OrderDO> selectByOrderIdList(@Param("orderIdList") Set<Long> orderIdList);
|
List<OrderDO> selectByOrderIdList(@Param("orderIdList") Set<Long> orderIdList);
|
||||||
|
|
||||||
OrderDO selectByOrderId(@Param("orderId") Long orderId);
|
OrderDO selectByOrderId(@Param("orderId") Long orderId);
|
||||||
|
|
||||||
IPage<OrderDO> selectPage(IPage<OrderDO> page, @Param(Constants.WRAPPER) LambdaQueryWrapper<OrderDO> queryWrapper, @Param("query") OrderPageQry orderPageQry);
|
IPage<OrderDO> selectPage(IPage<OrderDO> page, @Param(Constants.WRAPPER) LambdaQueryWrapper<OrderDO> queryWrapper, @Param("query") OrderPageQry orderPageQry);
|
||||||
|
|
||||||
List<OrderDO> selectByQueryList(@Param(Constants.WRAPPER)LambdaQueryWrapper<OrderDO> queryWrapper, @Param("query") OrderListQry orderListQry);
|
List<OrderDO> selectByQueryList(@Param(Constants.WRAPPER)LambdaQueryWrapper<OrderDO> queryWrapper, @Param("query") OrderListQry orderListQry);
|
||||||
|
|
||||||
List<OrderDO> selectByReconciliationIdList(@Param("reconciliationIdList") Set<Long> reconciliationIdList);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -3,16 +3,11 @@ package com.xunhong.erp.turbo.biz.infrastructure.mapper;
|
|||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import com.xunhong.erp.turbo.biz.infrastructure.entity.OrderShipDO;
|
import com.xunhong.erp.turbo.biz.infrastructure.entity.OrderShipDO;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
import org.apache.ibatis.annotations.Param;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Set;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author shenyifei
|
* @author shenyifei
|
||||||
*/
|
*/
|
||||||
@Mapper
|
@Mapper
|
||||||
public interface OrderShipMapper extends BaseMapper<OrderShipDO> {
|
public interface OrderShipMapper extends BaseMapper<OrderShipDO> {
|
||||||
List<OrderShipDO> selectByReconciliationIdList(@Param("reconciliationIdList") Set<Long> reconciliationIdList);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -6,6 +6,8 @@ import org.apache.ibatis.annotations.Mapper;
|
|||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
import org.apache.ibatis.annotations.Update;
|
import org.apache.ibatis.annotations.Update;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author shenyifei
|
* @author shenyifei
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -1,13 +0,0 @@
|
|||||||
package com.xunhong.erp.turbo.biz.infrastructure.mapper;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|
||||||
import com.xunhong.erp.turbo.biz.infrastructure.entity.ReconciliationInvoiceDO;
|
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author shenyifei
|
|
||||||
*/
|
|
||||||
@Mapper
|
|
||||||
public interface ReconciliationInvoiceMapper extends BaseMapper<ReconciliationInvoiceDO> {
|
|
||||||
}
|
|
||||||
|
|
||||||
@ -1,13 +0,0 @@
|
|||||||
package com.xunhong.erp.turbo.biz.infrastructure.mapper;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|
||||||
import com.xunhong.erp.turbo.biz.infrastructure.entity.ReconciliationItemDO;
|
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author shenyifei
|
|
||||||
*/
|
|
||||||
@Mapper
|
|
||||||
public interface ReconciliationItemMapper extends BaseMapper<ReconciliationItemDO> {
|
|
||||||
}
|
|
||||||
|
|
||||||
@ -1,19 +0,0 @@
|
|||||||
package com.xunhong.erp.turbo.biz.infrastructure.mapper;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
||||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
|
||||||
import com.xunhong.erp.turbo.api.biz.dto.qry.ReconciliationPageQry;
|
|
||||||
import com.xunhong.erp.turbo.biz.infrastructure.entity.ReconciliationDO;
|
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
|
||||||
import org.apache.ibatis.annotations.Param;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author shenyifei
|
|
||||||
*/
|
|
||||||
@Mapper
|
|
||||||
public interface ReconciliationMapper extends BaseMapper<ReconciliationDO> {
|
|
||||||
IPage<ReconciliationDO> selectPage(IPage<ReconciliationDO> page, @Param(Constants.WRAPPER) LambdaQueryWrapper<ReconciliationDO> queryWrapper, @Param("query") ReconciliationPageQry reconciliationPageQry);
|
|
||||||
}
|
|
||||||
|
|
||||||
@ -1,13 +0,0 @@
|
|||||||
package com.xunhong.erp.turbo.biz.infrastructure.mapper;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|
||||||
import com.xunhong.erp.turbo.biz.infrastructure.entity.ReconciliationPaymentDO;
|
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author shenyifei
|
|
||||||
*/
|
|
||||||
@Mapper
|
|
||||||
public interface ReconciliationPaymentMapper extends BaseMapper<ReconciliationPaymentDO> {
|
|
||||||
}
|
|
||||||
|
|
||||||
@ -11,7 +11,6 @@ import org.apache.ibatis.annotations.Param;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 发票记录表Mapper
|
* 发票记录表Mapper
|
||||||
*
|
|
||||||
* @author shenyifei
|
* @author shenyifei
|
||||||
*/
|
*/
|
||||||
@Mapper
|
@Mapper
|
||||||
|
|||||||
@ -1,134 +0,0 @@
|
|||||||
package com.xunhong.erp.turbo.biz.util;
|
|
||||||
|
|
||||||
import java.time.LocalDate;
|
|
||||||
import java.time.format.DateTimeFormatter;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 编号生成工具类
|
|
||||||
* <p>
|
|
||||||
* 用于生成各类业务编号,格式为:前缀 + 日期(YYYYMMDD) + 序号
|
|
||||||
* 例如:DZ20250113001, INV20250113002
|
|
||||||
*
|
|
||||||
* @author shenyifei
|
|
||||||
*/
|
|
||||||
public class SerialNumberGenerator {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 日期格式化器 - 基本格式(YYYYMMDD)
|
|
||||||
*/
|
|
||||||
private static final DateTimeFormatter BASIC_DATE_FORMATTER = DateTimeFormatter.BASIC_ISO_DATE;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 默认序号位数
|
|
||||||
*/
|
|
||||||
private static final int DEFAULT_SEQUENCE_DIGITS = 3;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 默认序号范围(0-999)
|
|
||||||
*/
|
|
||||||
private static final int MAX_SEQUENCE = 1000;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 私有构造函数,防止实例化
|
|
||||||
*/
|
|
||||||
private SerialNumberGenerator() {
|
|
||||||
throw new UnsupportedOperationException("Utility class cannot be instantiated");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 生成编号(不带前缀)
|
|
||||||
* <p>
|
|
||||||
* 格式:YYYYMMDD + 序号(3位)
|
|
||||||
* 例如:20250113001
|
|
||||||
*
|
|
||||||
* @return 编号字符串
|
|
||||||
*/
|
|
||||||
public static String generate() {
|
|
||||||
return generate(null, DEFAULT_SEQUENCE_DIGITS);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 生成编号(带前缀)
|
|
||||||
* <p>
|
|
||||||
* 格式:前缀 + YYYYMMDD + 序号(3位)
|
|
||||||
* 例如:DZ20250113001
|
|
||||||
*
|
|
||||||
* @param prefix 编号前缀(可为空)
|
|
||||||
* @return 编号字符串
|
|
||||||
*/
|
|
||||||
public static String generate(String prefix) {
|
|
||||||
return generate(prefix, DEFAULT_SEQUENCE_DIGITS);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 生成编号(自定义序号位数)
|
|
||||||
* <p>
|
|
||||||
* 格式:前缀 + YYYYMMDD + 序号
|
|
||||||
* 例如:DZ20250113001(3位序号)、DZ20250113000001(5位序号)
|
|
||||||
*
|
|
||||||
* @param prefix 编号前缀(可为空)
|
|
||||||
* @param sequenceDigits 序号位数
|
|
||||||
* @return 编号字符串
|
|
||||||
*/
|
|
||||||
public static String generate(String prefix, int sequenceDigits) {
|
|
||||||
String datePart = LocalDate.now().format(BASIC_DATE_FORMATTER);
|
|
||||||
int sequence = (int) (System.currentTimeMillis() % getMaxSequence(sequenceDigits));
|
|
||||||
String sequencePart = String.format("%0" + sequenceDigits + "d", sequence);
|
|
||||||
|
|
||||||
StringBuilder sb = new StringBuilder();
|
|
||||||
if (prefix != null && !prefix.isEmpty()) {
|
|
||||||
sb.append(prefix);
|
|
||||||
}
|
|
||||||
sb.append(datePart).append(sequencePart);
|
|
||||||
|
|
||||||
return sb.toString();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 生成日期部分(YYYYMMDD)
|
|
||||||
*
|
|
||||||
* @return 日期字符串
|
|
||||||
*/
|
|
||||||
public static String generateDatePart() {
|
|
||||||
return LocalDate.now().format(BASIC_DATE_FORMATTER);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 生成序号部分
|
|
||||||
*
|
|
||||||
* @param digits 序号位数
|
|
||||||
* @return 序号字符串
|
|
||||||
*/
|
|
||||||
public static String generateSequencePart(int digits) {
|
|
||||||
int sequence = (int) (System.currentTimeMillis() % getMaxSequence(digits));
|
|
||||||
return String.format("%0" + digits + "d", sequence);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取指定位数的最大序号
|
|
||||||
*
|
|
||||||
* @param digits 序号位数
|
|
||||||
* @return 最大序号(10的digits次方)
|
|
||||||
*/
|
|
||||||
private static int getMaxSequence(int digits) {
|
|
||||||
if (digits <= 0) {
|
|
||||||
throw new IllegalArgumentException("Sequence digits must be positive");
|
|
||||||
}
|
|
||||||
if (digits > 9) {
|
|
||||||
throw new IllegalArgumentException("Sequence digits cannot exceed 9");
|
|
||||||
}
|
|
||||||
return (int) Math.pow(10, digits);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 生成编号(使用当前时间戳的低3位作为序号)
|
|
||||||
* <p>
|
|
||||||
* 与旧代码兼容的方法,生成格式:YYYYMMDD + 3位序号
|
|
||||||
*
|
|
||||||
* @return 编号字符串
|
|
||||||
*/
|
|
||||||
public static String generateLegacy() {
|
|
||||||
return LocalDate.now().format(BASIC_DATE_FORMATTER)
|
|
||||||
+ String.format("%03d", System.currentTimeMillis() % MAX_SEQUENCE);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -6,5 +6,9 @@ spring:
|
|||||||
config:
|
config:
|
||||||
import: classpath:cache.yml,classpath:datasource.yml,classpath:rpc.yml,classpath:sa-token.yml
|
import: classpath:cache.yml,classpath:datasource.yml,classpath:rpc.yml,classpath:sa-token.yml
|
||||||
|
|
||||||
|
logging:
|
||||||
|
level:
|
||||||
|
com.xunhong.erp.turbo.third.mapper: debug
|
||||||
|
|
||||||
server:
|
server:
|
||||||
port: 8089
|
port: 8089
|
||||||
|
|||||||
@ -1,9 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
||||||
<mapper namespace="com.xunhong.erp.turbo.biz.infrastructure.mapper.AuditMapper">
|
<mapper namespace="com.xunhong.erp.turbo.biz.infrastructure.mapper.AuditMapper">
|
||||||
<resultMap id="BaseResultMap"
|
<resultMap id="BaseResultMap" type="com.xunhong.erp.turbo.biz.infrastructure.entity.AuditDO">
|
||||||
type="com.xunhong.erp.turbo.biz.infrastructure.entity.AuditDO">
|
|
||||||
<result property="auditId" column="audit_id"/>
|
<result property="auditId" column="audit_id"/>
|
||||||
<result property="subjectId" column="subject_id"/>
|
<result property="subjectId" column="subject_id"/>
|
||||||
<result property="subjectType" column="subject_type"/>
|
<result property="subjectType" column="subject_type"/>
|
||||||
|
|||||||
@ -1,10 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
<mapper namespace="com.xunhong.erp.turbo.biz.infrastructure.mapper.BoxSpecMapper">
|
||||||
<mapper
|
<resultMap id="BaseResultMap" type="com.xunhong.erp.turbo.biz.infrastructure.entity.BoxSpecDO">
|
||||||
namespace="com.xunhong.erp.turbo.biz.infrastructure.mapper.BoxSpecMapper">
|
|
||||||
<resultMap id="BaseResultMap"
|
|
||||||
type="com.xunhong.erp.turbo.biz.infrastructure.entity.BoxSpecDO">
|
|
||||||
<result property="specId" column="spec_id"/>
|
<result property="specId" column="spec_id"/>
|
||||||
<result property="name" column="name"/>
|
<result property="name" column="name"/>
|
||||||
<result property="sort" column="sort"/>
|
<result property="sort" column="sort"/>
|
||||||
|
|||||||
@ -1,9 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
||||||
<mapper namespace="com.xunhong.erp.turbo.biz.infrastructure.mapper.CostMapper">
|
<mapper namespace="com.xunhong.erp.turbo.biz.infrastructure.mapper.CostMapper">
|
||||||
<resultMap id="BaseResultMap"
|
<resultMap id="BaseResultMap" type="com.xunhong.erp.turbo.biz.infrastructure.entity.CostDO">
|
||||||
type="com.xunhong.erp.turbo.biz.infrastructure.entity.CostDO">
|
|
||||||
<result property="costId" column="cost_id"/>
|
<result property="costId" column="cost_id"/>
|
||||||
<result property="type" column="type"/>
|
<result property="type" column="type"/>
|
||||||
<result property="belong" column="belong"/>
|
<result property="belong" column="belong"/>
|
||||||
|
|||||||
@ -1,26 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
||||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
||||||
<mapper
|
|
||||||
namespace="com.xunhong.erp.turbo.biz.infrastructure.mapper.DealerAccountRecordMapper">
|
|
||||||
<resultMap id="BaseResultMap"
|
|
||||||
type="com.xunhong.erp.turbo.biz.infrastructure.entity.DealerAccountRecordDO">
|
|
||||||
<result property="dealerAccountRecordId"
|
|
||||||
column="dealer_account_record_id"/>
|
|
||||||
<result property="recordSn" column="record_sn"/>
|
|
||||||
<result property="dealerId" column="dealer_id"/>
|
|
||||||
<result property="orderId" column="order_id"/>
|
|
||||||
<result property="targetId" column="target_id"/>
|
|
||||||
<result property="targetType" column="target_type"/>
|
|
||||||
<result property="beforeAmount" column="before_amount"/>
|
|
||||||
<result property="amount" column="amount"/>
|
|
||||||
<result property="afterAmount" column="after_amount"/>
|
|
||||||
<result property="remark" column="remark"/>
|
|
||||||
<result property="createdAt" column="created_at"/>
|
|
||||||
<result property="createdAt" column="created_at"/>
|
|
||||||
<result property="updatedAt" column="updated_at"/>
|
|
||||||
<result property="isDelete" column="is_delete"/>
|
|
||||||
<result property="version" column="version"/>
|
|
||||||
</resultMap>
|
|
||||||
</mapper>
|
|
||||||
|
|
||||||
@ -1,10 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
<mapper namespace="com.xunhong.erp.turbo.biz.infrastructure.mapper.ExpenseCostMapper">
|
||||||
<mapper
|
<resultMap id="BaseResultMap" type="com.xunhong.erp.turbo.biz.infrastructure.entity.ExpenseCostDO">
|
||||||
namespace="com.xunhong.erp.turbo.biz.infrastructure.mapper.ExpenseCostMapper">
|
|
||||||
<resultMap id="BaseResultMap"
|
|
||||||
type="com.xunhong.erp.turbo.biz.infrastructure.entity.ExpenseCostDO">
|
|
||||||
<result property="expenseCostId" column="expense_cost_id"/>
|
<result property="expenseCostId" column="expense_cost_id"/>
|
||||||
<result property="expenseRecordId" column="expense_record_id"/>
|
<result property="expenseRecordId" column="expense_record_id"/>
|
||||||
<result property="costId" column="cost_id"/>
|
<result property="costId" column="cost_id"/>
|
||||||
|
|||||||
@ -1,10 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
<mapper namespace="com.xunhong.erp.turbo.biz.infrastructure.mapper.ExpenseProvisionMapper">
|
||||||
<mapper
|
<resultMap id="BaseResultMap" type="com.xunhong.erp.turbo.biz.infrastructure.entity.ExpenseProvisionDO">
|
||||||
namespace="com.xunhong.erp.turbo.biz.infrastructure.mapper.ExpenseProvisionMapper">
|
|
||||||
<resultMap id="BaseResultMap"
|
|
||||||
type="com.xunhong.erp.turbo.biz.infrastructure.entity.ExpenseProvisionDO">
|
|
||||||
<result property="expenseProvisionId" column="expense_provision_id"/>
|
<result property="expenseProvisionId" column="expense_provision_id"/>
|
||||||
<result property="expenseRecordId" column="expense_record_id"/>
|
<result property="expenseRecordId" column="expense_record_id"/>
|
||||||
<result property="dealerName" column="dealer_name"/>
|
<result property="dealerName" column="dealer_name"/>
|
||||||
|
|||||||
@ -1,10 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
<mapper namespace="com.xunhong.erp.turbo.biz.infrastructure.mapper.ExpenseRecordMapper">
|
||||||
<mapper
|
<resultMap id="BaseResultMap" type="com.xunhong.erp.turbo.biz.infrastructure.entity.ExpenseRecordDO">
|
||||||
namespace="com.xunhong.erp.turbo.biz.infrastructure.mapper.ExpenseRecordMapper">
|
|
||||||
<resultMap id="BaseResultMap"
|
|
||||||
type="com.xunhong.erp.turbo.biz.infrastructure.entity.ExpenseRecordDO">
|
|
||||||
<result property="expenseRecordId" column="expense_record_id"/>
|
<result property="expenseRecordId" column="expense_record_id"/>
|
||||||
<result property="recordDate" column="record_date"/>
|
<result property="recordDate" column="record_date"/>
|
||||||
<result property="totalProvision" column="total_provision"/>
|
<result property="totalProvision" column="total_provision"/>
|
||||||
|
|||||||
@ -1,10 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
<mapper namespace="com.xunhong.erp.turbo.biz.infrastructure.mapper.OrderCostItemMapper">
|
||||||
<mapper
|
<resultMap id="BaseResultMap" type="com.xunhong.erp.turbo.biz.infrastructure.entity.OrderCostItemDO">
|
||||||
namespace="com.xunhong.erp.turbo.biz.infrastructure.mapper.OrderCostItemMapper">
|
|
||||||
<resultMap id="BaseResultMap"
|
|
||||||
type="com.xunhong.erp.turbo.biz.infrastructure.entity.OrderCostItemDO">
|
|
||||||
<id property="orderCostItemId" column="order_cost_item_id"/>
|
<id property="orderCostItemId" column="order_cost_item_id"/>
|
||||||
<result property="orderId" column="order_id"/>
|
<result property="orderId" column="order_id"/>
|
||||||
<result property="costItemId" column="cost_item_id"/>
|
<result property="costItemId" column="cost_item_id"/>
|
||||||
|
|||||||
@ -94,8 +94,7 @@
|
|||||||
ov.dealer_id,
|
ov.dealer_id,
|
||||||
ov.dealer_name
|
ov.dealer_name
|
||||||
FROM order_cost oc
|
FROM order_cost oc
|
||||||
LEFT JOIN order_vehicle ov ON oc.order_id = ov.order_id AND ov.is_delete
|
LEFT JOIN order_vehicle ov ON oc.order_id = ov.order_id AND ov.is_delete = 0
|
||||||
= 0
|
|
||||||
LEFT JOIN `order` po ON oc.order_id = po.order_id AND
|
LEFT JOIN `order` po ON oc.order_id = po.order_id AND
|
||||||
po.is_delete = 0
|
po.is_delete = 0
|
||||||
WHERE oc.order_id = #{orderId}
|
WHERE oc.order_id = #{orderId}
|
||||||
|
|||||||
@ -157,28 +157,5 @@
|
|||||||
</if>
|
</if>
|
||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
<select id="selectByReconciliationIdList"
|
|
||||||
resultType="com.xunhong.erp.turbo.biz.infrastructure.entity.OrderDO">
|
|
||||||
SELECT
|
|
||||||
po.*,
|
|
||||||
ov.vehicle_id, ov.vehicle_no, ov.dealer_id, ov.dealer_name, ov.origin,
|
|
||||||
ov.destination
|
|
||||||
FROM `order` po
|
|
||||||
LEFT JOIN order_vehicle ov ON po.order_id = ov.order_id AND ov.is_delete
|
|
||||||
= 0
|
|
||||||
<where>
|
|
||||||
po.is_delete = 0
|
|
||||||
<if test="reconciliationIdList != null and reconciliationIdList.size() > 0">
|
|
||||||
AND po.order_id IN (select order_id from reconciliation_item
|
|
||||||
where
|
|
||||||
reconciliation_id in
|
|
||||||
<foreach item="item" collection="reconciliationIdList"
|
|
||||||
separator=","
|
|
||||||
open="(" close=")" index="">
|
|
||||||
#{item}
|
|
||||||
</foreach>)
|
|
||||||
</if>
|
|
||||||
</where>
|
|
||||||
</select>
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user