mirror of
https://github.com/hpd840321/craftlabs-authorization-sdk.git
synced 2026-06-09 10:00:30 +08:00
feat(m3): add field environment info (address, network, contact) to delivery
This commit is contained in:
+44
@@ -39,6 +39,18 @@ public class PlatformDeliveryBatch {
|
|||||||
@TableField("updated_at")
|
@TableField("updated_at")
|
||||||
private OffsetDateTime updatedAt;
|
private OffsetDateTime updatedAt;
|
||||||
|
|
||||||
|
@TableField("site_address")
|
||||||
|
private String siteAddress;
|
||||||
|
|
||||||
|
@TableField("network_requirements")
|
||||||
|
private String networkRequirements;
|
||||||
|
|
||||||
|
@TableField("site_contact")
|
||||||
|
private String siteContact;
|
||||||
|
|
||||||
|
@TableField("site_contact_phone")
|
||||||
|
private String siteContactPhone;
|
||||||
|
|
||||||
public Long getId() {
|
public Long getId() {
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
@@ -118,4 +130,36 @@ public class PlatformDeliveryBatch {
|
|||||||
public void setUpdatedAt(OffsetDateTime updatedAt) {
|
public void setUpdatedAt(OffsetDateTime updatedAt) {
|
||||||
this.updatedAt = updatedAt;
|
this.updatedAt = updatedAt;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getSiteAddress() {
|
||||||
|
return siteAddress;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSiteAddress(String siteAddress) {
|
||||||
|
this.siteAddress = siteAddress;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getNetworkRequirements() {
|
||||||
|
return networkRequirements;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNetworkRequirements(String networkRequirements) {
|
||||||
|
this.networkRequirements = networkRequirements;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSiteContact() {
|
||||||
|
return siteContact;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSiteContact(String siteContact) {
|
||||||
|
this.siteContact = siteContact;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSiteContactPhone() {
|
||||||
|
return siteContactPhone;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSiteContactPhone(String siteContactPhone) {
|
||||||
|
this.siteContactPhone = siteContactPhone;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+28
-2
@@ -91,6 +91,10 @@ public class DeliveryBatchService {
|
|||||||
b.setPlannedDeliveryDate(parsePlannedDateOrNull(request.getPlannedDeliveryDate()));
|
b.setPlannedDeliveryDate(parsePlannedDateOrNull(request.getPlannedDeliveryDate()));
|
||||||
b.setStatus(DeliveryBatchStatus.PENDING.name());
|
b.setStatus(DeliveryBatchStatus.PENDING.name());
|
||||||
b.setRemarks(blankToNull(request.getRemarks()));
|
b.setRemarks(blankToNull(request.getRemarks()));
|
||||||
|
b.setSiteAddress(null);
|
||||||
|
b.setNetworkRequirements(blankToNull(request.getNetworkRequirements()));
|
||||||
|
b.setSiteContact(blankToNull(request.getSiteContact()));
|
||||||
|
b.setSiteContactPhone(blankToNull(request.getSiteContactPhone()));
|
||||||
b.setCreatedAt(now);
|
b.setCreatedAt(now);
|
||||||
b.setUpdatedAt(now);
|
b.setUpdatedAt(now);
|
||||||
batchMapper.insert(b);
|
batchMapper.insert(b);
|
||||||
@@ -133,10 +137,12 @@ public class DeliveryBatchService {
|
|||||||
public DeliveryBatchResponse update(long id, DeliveryBatchUpdateRequest request) {
|
public DeliveryBatchResponse update(long id, DeliveryBatchUpdateRequest request) {
|
||||||
PlatformDeliveryBatch b = requireBatch(id);
|
PlatformDeliveryBatch b = requireBatch(id);
|
||||||
requirePendingForHeaderEdit(b);
|
requirePendingForHeaderEdit(b);
|
||||||
if (request.getPlannedDeliveryDate() == null && request.getRemarks() == null) {
|
if (request.getPlannedDeliveryDate() == null && request.getRemarks() == null
|
||||||
|
&& request.getSiteAddress() == null && request.getNetworkRequirements() == null
|
||||||
|
&& request.getSiteContact() == null && request.getSiteContactPhone() == null) {
|
||||||
throw new ResponseStatusException(
|
throw new ResponseStatusException(
|
||||||
HttpStatus.BAD_REQUEST,
|
HttpStatus.BAD_REQUEST,
|
||||||
"at least one of plannedDeliveryDate or remarks must be provided");
|
"at least one field must be provided");
|
||||||
}
|
}
|
||||||
String oldJson = toJson(batchSnapshot(b));
|
String oldJson = toJson(batchSnapshot(b));
|
||||||
if (request.getPlannedDeliveryDate() != null) {
|
if (request.getPlannedDeliveryDate() != null) {
|
||||||
@@ -145,6 +151,18 @@ public class DeliveryBatchService {
|
|||||||
if (request.getRemarks() != null) {
|
if (request.getRemarks() != null) {
|
||||||
b.setRemarks(blankToNull(request.getRemarks()));
|
b.setRemarks(blankToNull(request.getRemarks()));
|
||||||
}
|
}
|
||||||
|
if (request.getSiteAddress() != null) {
|
||||||
|
b.setSiteAddress(blankToNull(request.getSiteAddress()));
|
||||||
|
}
|
||||||
|
if (request.getNetworkRequirements() != null) {
|
||||||
|
b.setNetworkRequirements(blankToNull(request.getNetworkRequirements()));
|
||||||
|
}
|
||||||
|
if (request.getSiteContact() != null) {
|
||||||
|
b.setSiteContact(blankToNull(request.getSiteContact()));
|
||||||
|
}
|
||||||
|
if (request.getSiteContactPhone() != null) {
|
||||||
|
b.setSiteContactPhone(blankToNull(request.getSiteContactPhone()));
|
||||||
|
}
|
||||||
b.setUpdatedAt(OffsetDateTime.now(ZoneOffset.UTC));
|
b.setUpdatedAt(OffsetDateTime.now(ZoneOffset.UTC));
|
||||||
batchMapper.updateById(b);
|
batchMapper.updateById(b);
|
||||||
auditService.record(
|
auditService.record(
|
||||||
@@ -401,6 +419,10 @@ public class DeliveryBatchService {
|
|||||||
m.put("status", b.getStatus());
|
m.put("status", b.getStatus());
|
||||||
m.put("finishedAt", b.getFinishedAt());
|
m.put("finishedAt", b.getFinishedAt());
|
||||||
m.put("remarks", b.getRemarks());
|
m.put("remarks", b.getRemarks());
|
||||||
|
m.put("siteAddress", b.getSiteAddress());
|
||||||
|
m.put("networkRequirements", b.getNetworkRequirements());
|
||||||
|
m.put("siteContact", b.getSiteContact());
|
||||||
|
m.put("siteContactPhone", b.getSiteContactPhone());
|
||||||
return m;
|
return m;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -433,6 +455,10 @@ public class DeliveryBatchService {
|
|||||||
r.setStatus(b.getStatus());
|
r.setStatus(b.getStatus());
|
||||||
r.setFinishedAt(b.getFinishedAt());
|
r.setFinishedAt(b.getFinishedAt());
|
||||||
r.setRemarks(b.getRemarks());
|
r.setRemarks(b.getRemarks());
|
||||||
|
r.setSiteAddress(b.getSiteAddress());
|
||||||
|
r.setNetworkRequirements(b.getNetworkRequirements());
|
||||||
|
r.setSiteContact(b.getSiteContact());
|
||||||
|
r.setSiteContactPhone(b.getSiteContactPhone());
|
||||||
r.setCreatedAt(b.getCreatedAt());
|
r.setCreatedAt(b.getCreatedAt());
|
||||||
r.setUpdatedAt(b.getUpdatedAt());
|
r.setUpdatedAt(b.getUpdatedAt());
|
||||||
return r;
|
return r;
|
||||||
|
|||||||
+33
@@ -20,6 +20,15 @@ public class DeliveryBatchCreateRequest {
|
|||||||
@Size(max = 4000)
|
@Size(max = 4000)
|
||||||
private String remarks;
|
private String remarks;
|
||||||
|
|
||||||
|
@Size(max = 512)
|
||||||
|
private String networkRequirements;
|
||||||
|
|
||||||
|
@Size(max = 128)
|
||||||
|
private String siteContact;
|
||||||
|
|
||||||
|
@Size(max = 32)
|
||||||
|
private String siteContactPhone;
|
||||||
|
|
||||||
public Long getProjectId() {
|
public Long getProjectId() {
|
||||||
return projectId;
|
return projectId;
|
||||||
}
|
}
|
||||||
@@ -59,4 +68,28 @@ public class DeliveryBatchCreateRequest {
|
|||||||
public void setRemarks(String remarks) {
|
public void setRemarks(String remarks) {
|
||||||
this.remarks = remarks;
|
this.remarks = remarks;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getNetworkRequirements() {
|
||||||
|
return networkRequirements;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNetworkRequirements(String networkRequirements) {
|
||||||
|
this.networkRequirements = networkRequirements;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSiteContact() {
|
||||||
|
return siteContact;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSiteContact(String siteContact) {
|
||||||
|
this.siteContact = siteContact;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSiteContactPhone() {
|
||||||
|
return siteContactPhone;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSiteContactPhone(String siteContactPhone) {
|
||||||
|
this.siteContactPhone = siteContactPhone;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+40
@@ -19,6 +19,14 @@ public class DeliveryBatchResponse {
|
|||||||
private OffsetDateTime createdAt;
|
private OffsetDateTime createdAt;
|
||||||
private OffsetDateTime updatedAt;
|
private OffsetDateTime updatedAt;
|
||||||
|
|
||||||
|
private String siteAddress;
|
||||||
|
|
||||||
|
private String networkRequirements;
|
||||||
|
|
||||||
|
private String siteContact;
|
||||||
|
|
||||||
|
private String siteContactPhone;
|
||||||
|
|
||||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||||
private List<DeliveryLineResponse> lines;
|
private List<DeliveryLineResponse> lines;
|
||||||
|
|
||||||
@@ -102,6 +110,38 @@ public class DeliveryBatchResponse {
|
|||||||
this.updatedAt = updatedAt;
|
this.updatedAt = updatedAt;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getSiteAddress() {
|
||||||
|
return siteAddress;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSiteAddress(String siteAddress) {
|
||||||
|
this.siteAddress = siteAddress;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getNetworkRequirements() {
|
||||||
|
return networkRequirements;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNetworkRequirements(String networkRequirements) {
|
||||||
|
this.networkRequirements = networkRequirements;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSiteContact() {
|
||||||
|
return siteContact;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSiteContact(String siteContact) {
|
||||||
|
this.siteContact = siteContact;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSiteContactPhone() {
|
||||||
|
return siteContactPhone;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSiteContactPhone(String siteContactPhone) {
|
||||||
|
this.siteContactPhone = siteContactPhone;
|
||||||
|
}
|
||||||
|
|
||||||
public List<DeliveryLineResponse> getLines() {
|
public List<DeliveryLineResponse> getLines() {
|
||||||
return lines;
|
return lines;
|
||||||
}
|
}
|
||||||
|
|||||||
+43
@@ -9,6 +9,17 @@ public class DeliveryBatchUpdateRequest {
|
|||||||
@Size(max = 4000)
|
@Size(max = 4000)
|
||||||
private String remarks;
|
private String remarks;
|
||||||
|
|
||||||
|
private String siteAddress;
|
||||||
|
|
||||||
|
@Size(max = 512)
|
||||||
|
private String networkRequirements;
|
||||||
|
|
||||||
|
@Size(max = 128)
|
||||||
|
private String siteContact;
|
||||||
|
|
||||||
|
@Size(max = 32)
|
||||||
|
private String siteContactPhone;
|
||||||
|
|
||||||
public String getPlannedDeliveryDate() {
|
public String getPlannedDeliveryDate() {
|
||||||
return plannedDeliveryDate;
|
return plannedDeliveryDate;
|
||||||
}
|
}
|
||||||
@@ -24,4 +35,36 @@ public class DeliveryBatchUpdateRequest {
|
|||||||
public void setRemarks(String remarks) {
|
public void setRemarks(String remarks) {
|
||||||
this.remarks = remarks;
|
this.remarks = remarks;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getSiteAddress() {
|
||||||
|
return siteAddress;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSiteAddress(String siteAddress) {
|
||||||
|
this.siteAddress = siteAddress;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getNetworkRequirements() {
|
||||||
|
return networkRequirements;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNetworkRequirements(String networkRequirements) {
|
||||||
|
this.networkRequirements = networkRequirements;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSiteContact() {
|
||||||
|
return siteContact;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSiteContact(String siteContact) {
|
||||||
|
this.siteContact = siteContact;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSiteContactPhone() {
|
||||||
|
return siteContactPhone;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSiteContactPhone(String siteContactPhone) {
|
||||||
|
this.siteContactPhone = siteContactPhone;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+5
@@ -0,0 +1,5 @@
|
|||||||
|
ALTER TABLE platform_delivery_batch
|
||||||
|
ADD COLUMN site_address TEXT,
|
||||||
|
ADD COLUMN network_requirements VARCHAR(512),
|
||||||
|
ADD COLUMN site_contact VARCHAR(128),
|
||||||
|
ADD COLUMN site_contact_phone VARCHAR(32);
|
||||||
@@ -34,6 +34,30 @@
|
|||||||
</template>
|
</template>
|
||||||
<template v-else>{{ formatDate(batch.plannedDeliveryDate) }}</template>
|
<template v-else>{{ formatDate(batch.plannedDeliveryDate) }}</template>
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="部署地址">
|
||||||
|
<template v-if="isPending">
|
||||||
|
<el-input v-model="headerSiteAddress" maxlength="512" />
|
||||||
|
</template>
|
||||||
|
<template v-else>{{ batch.siteAddress || '—' }}</template>
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="网络要求">
|
||||||
|
<template v-if="isPending">
|
||||||
|
<el-input v-model="headerNetworkRequirements" maxlength="512" />
|
||||||
|
</template>
|
||||||
|
<template v-else>{{ batch.networkRequirements || '—' }}</template>
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="现场联系人">
|
||||||
|
<template v-if="isPending">
|
||||||
|
<el-input v-model="headerSiteContact" maxlength="128" />
|
||||||
|
</template>
|
||||||
|
<template v-else>{{ batch.siteContact || '—' }}</template>
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="联系人电话">
|
||||||
|
<template v-if="isPending">
|
||||||
|
<el-input v-model="headerSiteContactPhone" maxlength="32" />
|
||||||
|
</template>
|
||||||
|
<template v-else>{{ batch.siteContactPhone || '—' }}</template>
|
||||||
|
</el-descriptions-item>
|
||||||
<el-descriptions-item label="备注" :span="2">
|
<el-descriptions-item label="备注" :span="2">
|
||||||
<template v-if="isPending">
|
<template v-if="isPending">
|
||||||
<el-input v-model="headerRemarks" type="textarea" :rows="2" maxlength="4000" show-word-limit />
|
<el-input v-model="headerRemarks" type="textarea" :rows="2" maxlength="4000" show-word-limit />
|
||||||
@@ -122,6 +146,10 @@ const projectMap = ref(new Map());
|
|||||||
|
|
||||||
const headerPlannedDate = ref("");
|
const headerPlannedDate = ref("");
|
||||||
const headerRemarks = ref("");
|
const headerRemarks = ref("");
|
||||||
|
const headerSiteAddress = ref("");
|
||||||
|
const headerNetworkRequirements = ref("");
|
||||||
|
const headerSiteContact = ref("");
|
||||||
|
const headerSiteContactPhone = ref("");
|
||||||
|
|
||||||
const lineDialogVisible = ref(false);
|
const lineDialogVisible = ref(false);
|
||||||
const lineEditingId = ref(null);
|
const lineEditingId = ref(null);
|
||||||
@@ -165,6 +193,10 @@ watch(
|
|||||||
const d = b.plannedDeliveryDate;
|
const d = b.plannedDeliveryDate;
|
||||||
headerPlannedDate.value = d == null ? "" : typeof d === "string" ? d.slice(0, 10) : String(d).slice(0, 10);
|
headerPlannedDate.value = d == null ? "" : typeof d === "string" ? d.slice(0, 10) : String(d).slice(0, 10);
|
||||||
headerRemarks.value = b.remarks ?? "";
|
headerRemarks.value = b.remarks ?? "";
|
||||||
|
headerSiteAddress.value = b.siteAddress ?? "";
|
||||||
|
headerNetworkRequirements.value = b.networkRequirements ?? "";
|
||||||
|
headerSiteContact.value = b.siteContact ?? "";
|
||||||
|
headerSiteContactPhone.value = b.siteContactPhone ?? "";
|
||||||
},
|
},
|
||||||
{ immediate: true }
|
{ immediate: true }
|
||||||
);
|
);
|
||||||
@@ -250,6 +282,10 @@ async function saveHeader() {
|
|||||||
await updateDeliveryBatch(id, {
|
await updateDeliveryBatch(id, {
|
||||||
plannedDeliveryDate: headerPlannedDate.value || undefined,
|
plannedDeliveryDate: headerPlannedDate.value || undefined,
|
||||||
remarks: headerRemarks.value?.trim() ?? "",
|
remarks: headerRemarks.value?.trim() ?? "",
|
||||||
|
siteAddress: headerSiteAddress.value?.trim() || undefined,
|
||||||
|
networkRequirements: headerNetworkRequirements.value?.trim() || undefined,
|
||||||
|
siteContact: headerSiteContact.value?.trim() || undefined,
|
||||||
|
siteContactPhone: headerSiteContactPhone.value?.trim() || undefined,
|
||||||
});
|
});
|
||||||
ElMessage.success("已保存");
|
ElMessage.success("已保存");
|
||||||
await loadBatch();
|
await loadBatch();
|
||||||
|
|||||||
Reference in New Issue
Block a user