feat(smartCamCompare): 添加详情列表并优化创建逻辑

- 在 SmartCamCompareDto 中添加 details 字段,用于存储详情信息
- 在 SmartCamCompareService 中,为创建的实体的每个详情项设置对应的 SmartCamCompare 实体
This commit is contained in:
2025-05-24 23:07:59 +08:00
parent 4d5dcd988a
commit 1ac1c28997
3 changed files with 9 additions and 0 deletions

BIN
jrebel-classpath-12052.jar Normal file

Binary file not shown.

View File

@@ -9,6 +9,7 @@ import lombok.Data;
import org.hibernate.annotations.Comment;
import java.time.LocalDateTime;
import java.util.List;
@Data
public class SmartCamCompareDto extends OrgCommonDto {
@@ -50,4 +51,7 @@ public class SmartCamCompareDto extends OrgCommonDto {
@Comment("出场差值")
private Integer exitDiff;
private List<String> details;
}

View File

@@ -38,6 +38,11 @@ public class SmartCamCompareService
public SmartCamCompareDto create(CreateSmartCamCompareDto request) {
SmartCamCompareEntity entity = mapper.toEntity(request);
entity.getDetails().forEach(
detail -> {
detail.setSmartCamCompare(entity);
});
this.repository.save(entity);
return getById(entity.getId());
}