完善订单

This commit is contained in:
2024-09-06 10:32:20 +08:00
parent 02afe3d06f
commit a9c57b1e2a
7 changed files with 67 additions and 5 deletions

View File

@@ -61,6 +61,11 @@ public class CoalWashingDailyAnalysisService
CoalWashingDailyAnalysisEntity entity = mapper.toEntity(request);
entity.setOrganizationId(Ctx.currentUser().getOrganizationId());
validate(entity);
if (entity.getProduct()!=null){
entity.setName(entity.getProduct().getName());
}
this.repository.save(entity);
return getById(entity.getId());
}
@@ -102,7 +107,9 @@ public class CoalWashingDailyAnalysisService
validate(entity);
if (entity.getProduct()!=null){
entity.setName(entity.getProduct().getName());
}
this.repository.save(entity);
return getById(entity.getId());

View File

@@ -31,6 +31,8 @@ public class PurchaseOrderEntity extends OrgCommonEntity {
@OneToMany(mappedBy = "purchaseOrder", fetch = FetchType.LAZY)
private List<WeightDeviceDataEntity> weightDataList;
@@ -90,12 +92,10 @@ public class PurchaseOrderEntity extends OrgCommonEntity {
@Override
public void prePersist() {
super.prePersist();
this.startTime = this.purchaseDate==null ? null: this.purchaseDate.atStartOfDay();
}
@Override
public void preUpdate() {
super.preUpdate();
this.startTime = this.purchaseDate==null ? null: this.purchaseDate.atStartOfDay();
}
}

View File

@@ -103,12 +103,10 @@ public class SaleOrderEntity extends OrgCommonEntity {
@Override
public void prePersist() {
super.prePersist();
this.startTime = this.saleDate==null ? null: this.saleDate.atStartOfDay();
}
@Override
public void preUpdate() {
super.preUpdate();
this.startTime = this.saleDate==null ? null: this.saleDate.atStartOfDay();
}
}

View File

@@ -2,9 +2,16 @@ package cn.lihongjie.coal.supplier.dto;
import cn.lihongjie.coal.base.dto.OrgCommonDto;
import io.hypersistence.utils.hibernate.type.array.ListArrayType;
import jakarta.persistence.Column;
import lombok.Data;
import org.hibernate.annotations.Comment;
import org.hibernate.annotations.Type;
import java.util.List;
@Data
public class CreateSupplierDto extends OrgCommonDto {
@@ -26,4 +33,11 @@ public class CreateSupplierDto extends OrgCommonDto {
@Comment("是否客户")
private Boolean isCustomer;
@Comment("衡器宝别名")
@Column(columnDefinition = "text[]")
@Type(ListArrayType.class)
private List<String> weightDataAlias;
}

View File

@@ -2,9 +2,16 @@ package cn.lihongjie.coal.supplier.dto;
import cn.lihongjie.coal.base.dto.OrgCommonDto;
import io.hypersistence.utils.hibernate.type.array.ListArrayType;
import jakarta.persistence.Column;
import lombok.Data;
import org.hibernate.annotations.Comment;
import org.hibernate.annotations.Type;
import java.util.List;
@Data
public class SupplierDto extends OrgCommonDto {
@@ -25,4 +32,11 @@ public class SupplierDto extends OrgCommonDto {
@Comment("是否客户")
private Boolean isCustomer;
@Comment("衡器宝别名")
@Column(columnDefinition = "text[]")
@Type(ListArrayType.class)
private List<String> weightDataAlias;
}

View File

@@ -2,9 +2,16 @@ package cn.lihongjie.coal.supplier.dto;
import cn.lihongjie.coal.base.dto.OrgCommonDto;
import io.hypersistence.utils.hibernate.type.array.ListArrayType;
import jakarta.persistence.Column;
import lombok.Data;
import org.hibernate.annotations.Comment;
import org.hibernate.annotations.Type;
import java.util.List;
@Data
public class UpdateSupplierDto extends OrgCommonDto {
@@ -26,4 +33,11 @@ public class UpdateSupplierDto extends OrgCommonDto {
@Comment("是否客户")
private Boolean isCustomer;
@Comment("衡器宝别名")
@Column(columnDefinition = "text[]")
@Type(ListArrayType.class)
private List<String> weightDataAlias;
}

View File

@@ -2,11 +2,17 @@ package cn.lihongjie.coal.supplier.entity;
import cn.lihongjie.coal.base.entity.OrgCommonEntity;
import io.hypersistence.utils.hibernate.type.array.ListArrayType;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import lombok.Data;
import org.hibernate.annotations.Comment;
import org.hibernate.annotations.Type;
import java.util.List;
@Data
@Entity
@@ -32,4 +38,13 @@ public class SupplierEntity extends OrgCommonEntity {
@Comment("是否客户")
private Boolean isCustomer;
@Comment("衡器宝别名")
@Column(columnDefinition = "text[]")
@Type(ListArrayType.class)
private List<String> weightDataAlias;
}