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 industry;
|
||||
|
||||
private String address;
|
||||
|
||||
@TableField("billing_info")
|
||||
private String billingInfo;
|
||||
|
||||
@TableField("customer_code")
|
||||
private String customerCode;
|
||||
|
||||
@TableField("created_at")
|
||||
private OffsetDateTime createdAt;
|
||||
|
||||
@@ -58,6 +68,38 @@ public class PlatformCustomer {
|
||||
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() {
|
||||
return createdAt;
|
||||
}
|
||||
|
||||
+20
@@ -49,6 +49,10 @@ public class CustomerService {
|
||||
PlatformCustomer c = new PlatformCustomer();
|
||||
c.setName(request.getName().trim());
|
||||
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.setCreatedAt(now);
|
||||
c.setUpdatedAt(now);
|
||||
@@ -75,6 +79,18 @@ public class CustomerService {
|
||||
if (request.getCreditCode() != null) {
|
||||
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())) {
|
||||
c.setStatus(request.getStatus().trim());
|
||||
}
|
||||
@@ -120,6 +136,10 @@ public class CustomerService {
|
||||
r.setId(c.getId());
|
||||
r.setName(c.getName());
|
||||
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.setCreatedAt(c.getCreatedAt());
|
||||
r.setUpdatedAt(c.getUpdatedAt());
|
||||
|
||||
+44
@@ -15,6 +15,18 @@ public class CustomerRequest {
|
||||
@Size(max = 32)
|
||||
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() {
|
||||
return name;
|
||||
}
|
||||
@@ -38,4 +50,36 @@ public class CustomerRequest {
|
||||
public void setStatus(String 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 creditCode;
|
||||
private String status;
|
||||
private String industry;
|
||||
private String address;
|
||||
private String billingInfo;
|
||||
private String customerCode;
|
||||
private OffsetDateTime createdAt;
|
||||
private OffsetDateTime updatedAt;
|
||||
|
||||
@@ -43,6 +47,38 @@ public class CustomerResponse {
|
||||
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() {
|
||||
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-input v-model="form.creditCode" maxlength="32" clearable placeholder="选填" />
|
||||
</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>
|
||||
<template #footer>
|
||||
<el-button @click="dialogVisible = false">取消</el-button>
|
||||
@@ -81,6 +93,10 @@ const formRef = ref(null);
|
||||
const form = reactive({
|
||||
name: "",
|
||||
creditCode: "",
|
||||
industry: "",
|
||||
address: "",
|
||||
billingInfo: "",
|
||||
customerCode: "",
|
||||
});
|
||||
|
||||
const rules = {
|
||||
@@ -129,12 +145,20 @@ function openEdit(row) {
|
||||
editingId.value = row.id;
|
||||
form.name = row.name ?? "";
|
||||
form.creditCode = row.creditCode ?? "";
|
||||
form.industry = row.industry ?? "";
|
||||
form.address = row.address ?? "";
|
||||
form.billingInfo = row.billingInfo ?? "";
|
||||
form.customerCode = row.customerCode ?? "";
|
||||
dialogVisible.value = true;
|
||||
}
|
||||
|
||||
function resetForm() {
|
||||
form.name = "";
|
||||
form.creditCode = "";
|
||||
form.industry = "";
|
||||
form.address = "";
|
||||
form.billingInfo = "";
|
||||
form.customerCode = "";
|
||||
formRef.value?.resetFields?.();
|
||||
}
|
||||
|
||||
@@ -150,6 +174,10 @@ async function submit() {
|
||||
const payload = {
|
||||
name: form.name.trim(),
|
||||
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 {
|
||||
if (editingId.value != null) {
|
||||
|
||||
Reference in New Issue
Block a user