jz.kai 1 год назад
Родитель
Сommit
066d6e110a

+ 0 - 2
common/src/main/java/com/jpsoft/printing/modules/base/entity/Customer.java

@@ -38,6 +38,4 @@ public class Customer {
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm",timezone ="GMT+8")
 	    @ApiModelProperty(value = "更新时间")
     private Date updateTime;
-
-    private String allName;
 }

+ 4 - 28
web/src/main/java/com/jpsoft/printing/modules/ReportController.java

@@ -52,13 +52,7 @@ public class ReportController {
 
             Customer customer = customerService.get(account.getCustomerId());
             if(customer != null) {
-                String allName = "";
-                if (StringUtils.isNotEmpty(customer.getCompany())) {
-                    allName = customer.getName() + "(" + customer.getCompany() + ")";
-                } else {
-                    allName = customer.getName();
-                }
-                account.setCustomerName(allName);
+                account.setCustomerName(customer.getCompany());
             }
             else {
                 account.setCustomerName(null);
@@ -82,13 +76,7 @@ public class ReportController {
 
             Customer customer = customerService.get(account.getCustomerId());
             if(customer != null) {
-                String allName = "";
-                if (StringUtils.isNotEmpty(customer.getCompany())) {
-                    allName = customer.getName() + "(" + customer.getCompany() + ")";
-                } else {
-                    allName = customer.getName();
-                }
-                account.setCustomerName(allName);
+                account.setCustomerName(customer.getCompany());
             }
             else {
                 account.setCustomerName(null);
@@ -147,13 +135,7 @@ public class ReportController {
 
             Customer customer = customerService.get(account.getCustomerId());
             if(customer != null) {
-                String allName = "";
-                if (StringUtils.isNotEmpty(customer.getCompany())) {
-                    allName = customer.getName() + "(" + customer.getCompany() + ")";
-                } else {
-                    allName = customer.getName();
-                }
-                account.setCustomerName(allName);
+                account.setCustomerName(customer.getCompany());
             }
             else {
                 account.setCustomerName(null);
@@ -177,13 +159,7 @@ public class ReportController {
 
             Customer customer = customerService.get(account.getCustomerId());
             if(customer != null) {
-                String allName = "";
-                if (StringUtils.isNotEmpty(customer.getCompany())) {
-                    allName = customer.getName() + "(" + customer.getCompany() + ")";
-                } else {
-                    allName = customer.getName();
-                }
-                account.setCustomerName(allName);
+                account.setCustomerName(customer.getCompany());
             }
             else {
                 account.setCustomerName(null);

+ 2 - 17
web/src/main/java/com/jpsoft/printing/modules/base/controller/AccountController.java

@@ -180,13 +180,7 @@ public class AccountController {
         for(Account account : page.getResult()) {
             Customer customer = customerService.get(account.getCustomerId());
             if(customer != null) {
-                String allName = "";
-                if (StringUtils.isNotEmpty(customer.getCompany())) {
-                    allName = customer.getName() + "(" + customer.getCompany() + ")";
-                } else {
-                    allName = customer.getName();
-                }
-                account.setCustomerName(allName);
+                account.setCustomerName(customer.getCompany());
             }
         }
 
@@ -220,16 +214,7 @@ public class AccountController {
 
                 Customer customer = customerService.get(work.getCustomerId());
                 if(customer != null){
-                    String allName = "";
-
-                    if(StringUtils.isNotEmpty(customer.getCompany())){
-                        allName = customer.getName() + "(" + customer.getCompany() + ")";
-                    }
-                    else{
-                        allName = customer.getName();
-                    }
-
-                    work.setCustomerName(allName);
+                    work.setCustomerName(customer.getCompany());
                 }
 
                 work.setActualAmount(work.getActualQuantity().multiply(work.getUnitPrice()));

+ 0 - 12
web/src/main/java/com/jpsoft/printing/modules/base/controller/CustomerController.java

@@ -257,18 +257,6 @@ public class CustomerController {
         MessageResult msgResult = new MessageResult<>();
 
         List<Customer> list = customerService.list();
-        for(Customer customer : list){
-            String allName = "";
-
-            if(StringUtils.isNotEmpty(customer.getCompany())){
-                allName = customer.getName() + "(" + customer.getCompany() + ")";
-            }
-            else{
-                allName = customer.getName();
-            }
-
-            customer.setAllName(allName);
-        }
 
         msgResult.setResult(true);
         msgResult.setData(list);

+ 1 - 6
web/src/main/java/com/jpsoft/printing/modules/base/controller/WorkController.java

@@ -254,14 +254,9 @@ public class WorkController {
         Page<Work> page = workService.pageSearch(searchParams,pageIndex,pageSize,true,sortList);
         for(Work work : page.getResult()){
             Customer customer = customerService.get(work.getCustomerId());
-            String allName = "";
             if(StringUtils.isNotEmpty(customer.getCompany())){
-                allName = customer.getName() + "(" + customer.getCompany() + ")";
+                work.setCustomerName(customer.getCompany());
             }
-            else{
-                allName = customer.getName();
-            }
-            work.setCustomerName(allName);
 
             Account account = accountService.getByWorkId(work.getId());
             if(account != null){