mirror of
https://github.com/hpd840321/craftlabs-authorization-sdk.git
synced 2026-06-09 10:00:30 +08:00
feat(m1): add industry/address/billing/customerCode fields to customer
This commit is contained in:
+42
@@ -20,6 +20,16 @@ public class PlatformCustomer {
|
|||||||
|
|
||||||
private String status;
|
private String status;
|
||||||
|
|
||||||
|
private String industry;
|
||||||
|
|
||||||
|
private String address;
|
||||||
|
|
||||||
|
@TableField("billing_info")
|
||||||
|
private String billingInfo;
|
||||||
|
|
||||||
|
@TableField("customer_code")
|
||||||
|
private String customerCode;
|
||||||
|
|
||||||
@TableField("created_at")
|
@TableField("created_at")
|
||||||
private OffsetDateTime createdAt;
|
private OffsetDateTime createdAt;
|
||||||
|
|
||||||
@@ -58,6 +68,38 @@ public class PlatformCustomer {
|
|||||||
this.status = status;
|
this.status = status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getIndustry() {
|
||||||
|
return industry;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIndustry(String industry) {
|
||||||
|
this.industry = industry;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAddress() {
|
||||||
|
return address;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAddress(String address) {
|
||||||
|
this.address = address;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getBillingInfo() {
|
||||||
|
return billingInfo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBillingInfo(String billingInfo) {
|
||||||
|
this.billingInfo = billingInfo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCustomerCode() {
|
||||||
|
return customerCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCustomerCode(String customerCode) {
|
||||||
|
this.customerCode = customerCode;
|
||||||
|
}
|
||||||
|
|
||||||
public OffsetDateTime getCreatedAt() {
|
public OffsetDateTime getCreatedAt() {
|
||||||
return createdAt;
|
return createdAt;
|
||||||
}
|
}
|
||||||
|
|||||||
+20
@@ -49,6 +49,10 @@ public class CustomerService {
|
|||||||
PlatformCustomer c = new PlatformCustomer();
|
PlatformCustomer c = new PlatformCustomer();
|
||||||
c.setName(request.getName().trim());
|
c.setName(request.getName().trim());
|
||||||
c.setCreditCode(blankToNull(request.getCreditCode()));
|
c.setCreditCode(blankToNull(request.getCreditCode()));
|
||||||
|
c.setIndustry(blankToNull(request.getIndustry()));
|
||||||
|
c.setAddress(blankToNull(request.getAddress()));
|
||||||
|
c.setBillingInfo(blankToNull(request.getBillingInfo()));
|
||||||
|
c.setCustomerCode(blankToNull(request.getCustomerCode()));
|
||||||
c.setStatus(resolveStatusForCreate(request.getStatus()));
|
c.setStatus(resolveStatusForCreate(request.getStatus()));
|
||||||
c.setCreatedAt(now);
|
c.setCreatedAt(now);
|
||||||
c.setUpdatedAt(now);
|
c.setUpdatedAt(now);
|
||||||
@@ -75,6 +79,18 @@ public class CustomerService {
|
|||||||
if (request.getCreditCode() != null) {
|
if (request.getCreditCode() != null) {
|
||||||
c.setCreditCode(blankToNull(request.getCreditCode()));
|
c.setCreditCode(blankToNull(request.getCreditCode()));
|
||||||
}
|
}
|
||||||
|
if (request.getIndustry() != null) {
|
||||||
|
c.setIndustry(blankToNull(request.getIndustry()));
|
||||||
|
}
|
||||||
|
if (request.getAddress() != null) {
|
||||||
|
c.setAddress(blankToNull(request.getAddress()));
|
||||||
|
}
|
||||||
|
if (request.getBillingInfo() != null) {
|
||||||
|
c.setBillingInfo(blankToNull(request.getBillingInfo()));
|
||||||
|
}
|
||||||
|
if (request.getCustomerCode() != null) {
|
||||||
|
c.setCustomerCode(blankToNull(request.getCustomerCode()));
|
||||||
|
}
|
||||||
if (StringUtils.hasText(request.getStatus())) {
|
if (StringUtils.hasText(request.getStatus())) {
|
||||||
c.setStatus(request.getStatus().trim());
|
c.setStatus(request.getStatus().trim());
|
||||||
}
|
}
|
||||||
@@ -120,6 +136,10 @@ public class CustomerService {
|
|||||||
r.setId(c.getId());
|
r.setId(c.getId());
|
||||||
r.setName(c.getName());
|
r.setName(c.getName());
|
||||||
r.setCreditCode(c.getCreditCode());
|
r.setCreditCode(c.getCreditCode());
|
||||||
|
r.setIndustry(c.getIndustry());
|
||||||
|
r.setAddress(c.getAddress());
|
||||||
|
r.setBillingInfo(c.getBillingInfo());
|
||||||
|
r.setCustomerCode(c.getCustomerCode());
|
||||||
r.setStatus(c.getStatus());
|
r.setStatus(c.getStatus());
|
||||||
r.setCreatedAt(c.getCreatedAt());
|
r.setCreatedAt(c.getCreatedAt());
|
||||||
r.setUpdatedAt(c.getUpdatedAt());
|
r.setUpdatedAt(c.getUpdatedAt());
|
||||||
|
|||||||
+44
@@ -15,6 +15,18 @@ public class CustomerRequest {
|
|||||||
@Size(max = 32)
|
@Size(max = 32)
|
||||||
private String status;
|
private String status;
|
||||||
|
|
||||||
|
@Size(max = 128)
|
||||||
|
private String industry;
|
||||||
|
|
||||||
|
@Size(max = 512)
|
||||||
|
private String address;
|
||||||
|
|
||||||
|
@Size(max = 512)
|
||||||
|
private String billingInfo;
|
||||||
|
|
||||||
|
@Size(max = 64)
|
||||||
|
private String customerCode;
|
||||||
|
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
@@ -38,4 +50,36 @@ public class CustomerRequest {
|
|||||||
public void setStatus(String status) {
|
public void setStatus(String status) {
|
||||||
this.status = status;
|
this.status = status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getIndustry() {
|
||||||
|
return industry;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIndustry(String industry) {
|
||||||
|
this.industry = industry;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAddress() {
|
||||||
|
return address;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAddress(String address) {
|
||||||
|
this.address = address;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getBillingInfo() {
|
||||||
|
return billingInfo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBillingInfo(String billingInfo) {
|
||||||
|
this.billingInfo = billingInfo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCustomerCode() {
|
||||||
|
return customerCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCustomerCode(String customerCode) {
|
||||||
|
this.customerCode = customerCode;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+36
@@ -8,6 +8,10 @@ public class CustomerResponse {
|
|||||||
private String name;
|
private String name;
|
||||||
private String creditCode;
|
private String creditCode;
|
||||||
private String status;
|
private String status;
|
||||||
|
private String industry;
|
||||||
|
private String address;
|
||||||
|
private String billingInfo;
|
||||||
|
private String customerCode;
|
||||||
private OffsetDateTime createdAt;
|
private OffsetDateTime createdAt;
|
||||||
private OffsetDateTime updatedAt;
|
private OffsetDateTime updatedAt;
|
||||||
|
|
||||||
@@ -43,6 +47,38 @@ public class CustomerResponse {
|
|||||||
this.status = status;
|
this.status = status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getIndustry() {
|
||||||
|
return industry;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIndustry(String industry) {
|
||||||
|
this.industry = industry;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAddress() {
|
||||||
|
return address;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAddress(String address) {
|
||||||
|
this.address = address;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getBillingInfo() {
|
||||||
|
return billingInfo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBillingInfo(String billingInfo) {
|
||||||
|
this.billingInfo = billingInfo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCustomerCode() {
|
||||||
|
return customerCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCustomerCode(String customerCode) {
|
||||||
|
this.customerCode = customerCode;
|
||||||
|
}
|
||||||
|
|
||||||
public OffsetDateTime getCreatedAt() {
|
public OffsetDateTime getCreatedAt() {
|
||||||
return createdAt;
|
return createdAt;
|
||||||
}
|
}
|
||||||
|
|||||||
+11
@@ -0,0 +1,11 @@
|
|||||||
|
-- V9__m1_enhancements.sql
|
||||||
|
ALTER TABLE platform_customer
|
||||||
|
ADD COLUMN IF NOT EXISTS industry VARCHAR(128),
|
||||||
|
ADD COLUMN IF NOT EXISTS address TEXT,
|
||||||
|
ADD COLUMN IF NOT EXISTS billing_info TEXT,
|
||||||
|
ADD COLUMN IF NOT EXISTS customer_code VARCHAR(64);
|
||||||
|
|
||||||
|
ALTER TABLE platform_project
|
||||||
|
ADD COLUMN IF NOT EXISTS planned_start_date DATE,
|
||||||
|
ADD COLUMN IF NOT EXISTS planned_end_date DATE,
|
||||||
|
ADD COLUMN IF NOT EXISTS project_manager VARCHAR(128);
|
||||||
@@ -49,6 +49,18 @@
|
|||||||
<el-form-item label="统一社会信用代码" prop="creditCode">
|
<el-form-item label="统一社会信用代码" prop="creditCode">
|
||||||
<el-input v-model="form.creditCode" maxlength="32" clearable placeholder="选填" />
|
<el-input v-model="form.creditCode" maxlength="32" clearable placeholder="选填" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<el-form-item label="行业">
|
||||||
|
<el-input v-model="form.industry" maxlength="128" placeholder="选填" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="地址">
|
||||||
|
<el-input v-model="form.address" type="textarea" :rows="2" maxlength="512" placeholder="选填" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="开票信息">
|
||||||
|
<el-input v-model="form.billingInfo" type="textarea" :rows="2" maxlength="512" placeholder="选填" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="客户编码">
|
||||||
|
<el-input v-model="form.customerCode" maxlength="64" placeholder="选填" />
|
||||||
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<el-button @click="dialogVisible = false">取消</el-button>
|
<el-button @click="dialogVisible = false">取消</el-button>
|
||||||
@@ -81,6 +93,10 @@ const formRef = ref(null);
|
|||||||
const form = reactive({
|
const form = reactive({
|
||||||
name: "",
|
name: "",
|
||||||
creditCode: "",
|
creditCode: "",
|
||||||
|
industry: "",
|
||||||
|
address: "",
|
||||||
|
billingInfo: "",
|
||||||
|
customerCode: "",
|
||||||
});
|
});
|
||||||
|
|
||||||
const rules = {
|
const rules = {
|
||||||
@@ -129,12 +145,20 @@ function openEdit(row) {
|
|||||||
editingId.value = row.id;
|
editingId.value = row.id;
|
||||||
form.name = row.name ?? "";
|
form.name = row.name ?? "";
|
||||||
form.creditCode = row.creditCode ?? "";
|
form.creditCode = row.creditCode ?? "";
|
||||||
|
form.industry = row.industry ?? "";
|
||||||
|
form.address = row.address ?? "";
|
||||||
|
form.billingInfo = row.billingInfo ?? "";
|
||||||
|
form.customerCode = row.customerCode ?? "";
|
||||||
dialogVisible.value = true;
|
dialogVisible.value = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
function resetForm() {
|
function resetForm() {
|
||||||
form.name = "";
|
form.name = "";
|
||||||
form.creditCode = "";
|
form.creditCode = "";
|
||||||
|
form.industry = "";
|
||||||
|
form.address = "";
|
||||||
|
form.billingInfo = "";
|
||||||
|
form.customerCode = "";
|
||||||
formRef.value?.resetFields?.();
|
formRef.value?.resetFields?.();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -150,6 +174,10 @@ async function submit() {
|
|||||||
const payload = {
|
const payload = {
|
||||||
name: form.name.trim(),
|
name: form.name.trim(),
|
||||||
creditCode: form.creditCode?.trim() || undefined,
|
creditCode: form.creditCode?.trim() || undefined,
|
||||||
|
industry: form.industry?.trim() || undefined,
|
||||||
|
address: form.address?.trim() || undefined,
|
||||||
|
billingInfo: form.billingInfo?.trim() || undefined,
|
||||||
|
customerCode: form.customerCode?.trim() || undefined,
|
||||||
};
|
};
|
||||||
try {
|
try {
|
||||||
if (editingId.value != null) {
|
if (editingId.value != null) {
|
||||||
|
|||||||
Reference in New Issue
Block a user