feat(m2): add external/internal order ID to contracts

This commit is contained in:
2026-05-25 14:49:40 +08:00
parent 16ab474bee
commit 8d1081b2b9
8 changed files with 109 additions and 0 deletions
@@ -35,6 +35,12 @@ public class PlatformContract {
@TableField("end_date")
private LocalDate endDate;
@TableField("external_order_id")
private String externalOrderId;
@TableField("internal_order_id")
private String internalOrderId;
@TableField("created_at")
private OffsetDateTime createdAt;
@@ -113,6 +119,22 @@ public class PlatformContract {
this.endDate = endDate;
}
public String getExternalOrderId() {
return externalOrderId;
}
public void setExternalOrderId(String externalOrderId) {
this.externalOrderId = externalOrderId;
}
public String getInternalOrderId() {
return internalOrderId;
}
public void setInternalOrderId(String internalOrderId) {
this.internalOrderId = internalOrderId;
}
public OffsetDateTime getCreatedAt() {
return createdAt;
}
@@ -72,6 +72,8 @@ public class ContractService {
if (request.getSigningDate() != null) c.setSigningDate(LocalDate.parse(request.getSigningDate()));
if (request.getEffectiveDate() != null) c.setEffectiveDate(LocalDate.parse(request.getEffectiveDate()));
if (request.getEndDate() != null) c.setEndDate(LocalDate.parse(request.getEndDate()));
c.setExternalOrderId(request.getExternalOrderId());
c.setInternalOrderId(request.getInternalOrderId());
c.setStatus(ContractStatus.DRAFT.name());
c.setCreatedAt(now);
c.setUpdatedAt(now);
@@ -129,6 +131,8 @@ public class ContractService {
if (request.getSigningDate() != null) c.setSigningDate(LocalDate.parse(request.getSigningDate()));
if (request.getEffectiveDate() != null) c.setEffectiveDate(LocalDate.parse(request.getEffectiveDate()));
if (request.getEndDate() != null) c.setEndDate(LocalDate.parse(request.getEndDate()));
if (request.getExternalOrderId() != null) c.setExternalOrderId(request.getExternalOrderId());
if (request.getInternalOrderId() != null) c.setInternalOrderId(request.getInternalOrderId());
c.setUpdatedAt(OffsetDateTime.now(ZoneOffset.UTC));
contractMapper.updateById(c);
auditService.record(
@@ -331,6 +335,8 @@ public class ContractService {
m.put("signingDate", c.getSigningDate());
m.put("effectiveDate", c.getEffectiveDate());
m.put("endDate", c.getEndDate());
m.put("externalOrderId", c.getExternalOrderId());
m.put("internalOrderId", c.getInternalOrderId());
m.put("status", c.getStatus());
return m;
}
@@ -367,6 +373,8 @@ public class ContractService {
r.setSigningDate(c.getSigningDate() != null ? c.getSigningDate().toString() : null);
r.setEffectiveDate(c.getEffectiveDate() != null ? c.getEffectiveDate().toString() : null);
r.setEndDate(c.getEndDate() != null ? c.getEndDate().toString() : null);
r.setExternalOrderId(c.getExternalOrderId());
r.setInternalOrderId(c.getInternalOrderId());
r.setCreatedAt(c.getCreatedAt());
r.setUpdatedAt(c.getUpdatedAt());
return r;
@@ -21,6 +21,10 @@ public class ContractCreateRequest {
private String endDate;
private String externalOrderId;
private String internalOrderId;
public Long getCustomerId() {
return customerId;
}
@@ -76,4 +80,20 @@ public class ContractCreateRequest {
public void setEndDate(String endDate) {
this.endDate = endDate;
}
public String getExternalOrderId() {
return externalOrderId;
}
public void setExternalOrderId(String externalOrderId) {
this.externalOrderId = externalOrderId;
}
public String getInternalOrderId() {
return internalOrderId;
}
public void setInternalOrderId(String internalOrderId) {
this.internalOrderId = internalOrderId;
}
}
@@ -16,6 +16,8 @@ public class ContractResponse {
private String signingDate;
private String effectiveDate;
private String endDate;
private String externalOrderId;
private String internalOrderId;
private OffsetDateTime createdAt;
private OffsetDateTime updatedAt;
/** 仅详情接口填充;列表分页省略该字段。 */
@@ -94,6 +96,22 @@ public class ContractResponse {
this.endDate = endDate;
}
public String getExternalOrderId() {
return externalOrderId;
}
public void setExternalOrderId(String externalOrderId) {
this.externalOrderId = externalOrderId;
}
public String getInternalOrderId() {
return internalOrderId;
}
public void setInternalOrderId(String internalOrderId) {
this.internalOrderId = internalOrderId;
}
public OffsetDateTime getCreatedAt() {
return createdAt;
}
@@ -16,6 +16,10 @@ public class ContractUpdateRequest {
private String endDate;
private String externalOrderId;
private String internalOrderId;
public String getTitle() {
return title;
}
@@ -55,4 +59,20 @@ public class ContractUpdateRequest {
public void setEndDate(String endDate) {
this.endDate = endDate;
}
public String getExternalOrderId() {
return externalOrderId;
}
public void setExternalOrderId(String externalOrderId) {
this.externalOrderId = externalOrderId;
}
public String getInternalOrderId() {
return internalOrderId;
}
public void setInternalOrderId(String internalOrderId) {
this.internalOrderId = internalOrderId;
}
}
@@ -0,0 +1,3 @@
ALTER TABLE platform_contract
ADD COLUMN external_order_id VARCHAR(128),
ADD COLUMN internal_order_id VARCHAR(128);