|
@@ -1,5 +1,6 @@
|
|
|
package com.iamberry.rst.controllers.customer;
|
|
|
|
|
|
+import net.sf.json.JSONArray;
|
|
|
import com.iamberry.rst.core.address.City;
|
|
|
import com.iamberry.rst.core.address.Province;
|
|
|
import com.iamberry.rst.core.customer.*;
|
|
@@ -8,14 +9,14 @@ import com.iamberry.rst.core.order.ProductColor;
|
|
|
import com.iamberry.rst.core.order.ProductType;
|
|
|
import com.iamberry.rst.faces.customer.CustomerBasicInfoSaveService;
|
|
|
import com.iamberry.wechat.tools.ResponseJson;
|
|
|
+import net.sf.json.JSONObject;
|
|
|
import org.apache.commons.lang.StringUtils;
|
|
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Controller;
|
|
|
-import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
-import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
import org.springframework.web.servlet.ModelAndView;
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
import java.util.ArrayList;
|
|
@@ -46,19 +47,31 @@ public class CustomerBasicInfoSaveController {
|
|
|
|
|
|
* 添加客户信息
|
|
|
* @param request
|
|
|
- * @param customerBasicInfo
|
|
|
- * @param dockedContactInfoList
|
|
|
- * @param channelSaleInfoList
|
|
|
- * @param billingInfo
|
|
|
- * @param ticketOpeningInfo
|
|
|
* @return
|
|
|
* @throws Exception
|
|
|
*/
|
|
|
@ResponseBody
|
|
|
@RequiresPermissions("customerBasic:save:customerInfo")
|
|
|
@RequestMapping("/save_customer_info")
|
|
|
- public ResponseJson saveCustomerBasicInfo(HttpServletRequest request, CustomerBasicInfo customerBasicInfo, List<DockedContactInfo> dockedContactInfoList,
|
|
|
- List<ChannelSaleInfo> channelSaleInfoList,BillingInfo billingInfo, TicketOpeningInfo ticketOpeningInfo) throws Exception {
|
|
|
+ public ResponseJson saveCustomerBasicInfo(HttpServletRequest request,String customerInfoJson,
|
|
|
+ String billingInfoJson,String ticketOpeningInfoJson) throws Exception {
|
|
|
+
|
|
|
+ JSONObject customerJsonObject = JSONObject.fromObject(customerInfoJson);
|
|
|
+ CustomerBasicInfo customerBasicInfo = (CustomerBasicInfo) customerJsonObject.toBean(customerJsonObject,CustomerBasicInfo.class);
|
|
|
+
|
|
|
+ JSONObject billingInfoJsonObject = JSONObject.fromObject(billingInfoJson);
|
|
|
+ BillingInfo billingInfo = (BillingInfo) billingInfoJsonObject.toBean(billingInfoJsonObject,BillingInfo.class);
|
|
|
+
|
|
|
+ JSONObject ticketOpeningInfoJsonObject = JSONObject.fromObject(ticketOpeningInfoJson);
|
|
|
+ TicketOpeningInfo ticketOpeningInfo = (TicketOpeningInfo) customerJsonObject.toBean(customerJsonObject,TicketOpeningInfo.class);
|
|
|
+ logger.info("-----------------saveCustomerBasicInfo...Start----------------------");
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
ResponseJson rjx = this.isValiData(customerBasicInfo);
|
|
|
Boolean isSaveSuccess = false;
|
|
|
if(rjx.getResultCode() == 500){
|
|
@@ -66,7 +79,7 @@ public class CustomerBasicInfoSaveController {
|
|
|
}
|
|
|
logger.info("-----------------添加客户信息开始----------------------");
|
|
|
try {
|
|
|
- customerBasicInfoSaveService.saveCustomerBasicInfo(customerBasicInfo,dockedContactInfoList,channelSaleInfoList,billingInfo,ticketOpeningInfo);
|
|
|
+
|
|
|
isSaveSuccess = true;
|
|
|
} catch (RuntimeException e) {
|
|
|
isSaveSuccess = false;
|