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);
|
||||
Reference in New Issue
Block a user