Ver Fonte

优化 bug

ruqinhu há 5 anos atrás
pai
commit
8b184eb88f

+ 11 - 0
src/main/java/com/ygj/yuemum/service/customer/CustomerInfoBasicService.java

@@ -9,6 +9,7 @@ import com.ygj.yuemum.domain.customer.CustomerInfoServiceLog;
 import com.ygj.yuemum.domain.customer.dto.CustomerInfoBasicCyDto;
 import com.ygj.yuemum.domain.customer.dto.CustomerInfoBasicDto;
 import com.ygj.yuemum.service.admin.JlAdminUserService;
+import org.apache.commons.lang.StringUtils;
 import org.apache.shiro.SecurityUtils;
 import org.springframework.stereotype.Service;
 
@@ -37,6 +38,7 @@ public class CustomerInfoBasicService {
 
 
 	public int insert(CustomerInfoBasic customerInfoBasic) {
+		this.setDefValue(customerInfoBasic);
 		int count =  customerInfoBasicDao.insert(customerInfoBasic);
 		if (count != 0) {
 			this.insertServiceLog(customerInfoBasic.getId(), "新增", customerInfoBasic);
@@ -101,4 +103,13 @@ public class CustomerInfoBasicService {
 		customerInfoServiceLogService.insert(customerInfoServiceLog);
 	}
 
+	private void setDefValue(CustomerInfoBasic customerInfoBasic) {
+		if (StringUtils.isBlank(customerInfoBasic.getFb_customer_name())) {
+			customerInfoBasic.setFb_customer_name("");
+		}
+		if (StringUtils.isBlank(customerInfoBasic.getFb_customer_phone())) {
+			customerInfoBasic.setFb_customer_phone("");
+		}
+	}
+
 }

+ 12 - 4
src/main/java/com/ygj/yuemum/service/customer/CustomerInfoFeedbackService.java

@@ -10,7 +10,6 @@ import com.ygj.yuemum.domain.customer.dto.CustomerInfoFeedbackCyDto;
 import com.ygj.yuemum.domain.customer.dto.CustomerInfoFeedbackDto;
 import com.ygj.yuemum.service.admin.JlAdminUserService;
 import org.apache.commons.lang.StringUtils;
-import org.apache.shiro.SecurityUtils;
 import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
@@ -35,9 +34,7 @@ public class CustomerInfoFeedbackService {
     }
 
     public int insertInfoFeedback(CustomerInfoFeedback customerInfoFeedback) {
-        if (StringUtils.isBlank(customerInfoFeedback.getFb_remarks())) {
-            customerInfoFeedback.setFb_remarks("");
-        }
+        this.setDefValue(customerInfoFeedback);
         int count = feedbackDao.insertInfoFeedback(customerInfoFeedback);
         if (count != 0) {
             this.insertServiceLog(customerInfoFeedback.getId(), "新增", customerInfoFeedback);
@@ -74,4 +71,15 @@ public class CustomerInfoFeedbackService {
         customerInfoServiceLogService.insert(customerInfoServiceLog);
     }
 
+    private void setDefValue(CustomerInfoFeedback customerInfoFeedback) {
+        if (StringUtils.isBlank(customerInfoFeedback.getFb_remarks())) {
+            customerInfoFeedback.setFb_remarks("");
+        }
+        if (StringUtils.isBlank(customerInfoFeedback.getFb_customer_name())) {
+            customerInfoFeedback.setFb_customer_name("");
+        }
+        if (StringUtils.isBlank(customerInfoFeedback.getFb_customer_phone())) {
+            customerInfoFeedback.setFb_customer_phone("");
+        }
+    }
 }