Forráskód Böngészése

添加客户基本信息

dujinyan 7 éve
szülő
commit
f049c03e86

+ 44 - 5
watero-rst-interface/src/main/java/com/iamberry/rst/faces/customer/CustomerBasicInfoSaveService.java

@@ -3,15 +3,54 @@ package com.iamberry.rst.faces.customer;
 
 import com.iamberry.rst.core.customer.*;
 
+import java.util.List;
+
 public interface CustomerBasicInfoSaveService {
 
     /**
+     * 根据客户id查询客户基本信息
+     * @param queryCustomerId
+     * @return
+     */
+    public CustomerBasicInfo queryCustomerBasicInfoByCustomerId(int queryCustomerId);
+
+    /**
+     * 根据客户id查询对接联系人信息
+     * @param queryCustomerId
+     * @return
+     */
+    public List<DockedContactInfo> queryDockedContactInfoListByCustomerId(int queryCustomerId);
+
+    /**
+     * 根据客户id查询客户销售渠道备案信息
+     * @param queryCustomerId
+     * @return
+     */
+    public List<ChannelSaleInfo> queryChannelSaleInfoListByCustomerId(int queryCustomerId);
+
+    /**
+     * 根据客户id查询客户付款/退款信息
+     * @param queryCustomerId
+     * @return
+     */
+    public BillingInfo queryBillingInfoByCustomerId(int queryCustomerId);
+
+    /**
+     * 根据客户id查询客户开票信息
+     * @param queryCustomerId
+     * @return
+     */
+    public TicketOpeningInfo queryTicketOpeningInfoByCustomerId(int queryCustomerId);
+
+    /**
      * 添加客户基本信息
      *
      * @param customerBasicInfo
      * @return
      */
-    public void saveCustomerBasicInfo(CustomerBasicInfo customerBasicInfo);
+    public void saveCustomerBasicInfo(CustomerBasicInfo customerBasicInfo,DockedContactInfo dockedContactInfo, ChannelSaleInfo channelSaleInfo,
+                                     BillingInfo billingInfo, TicketOpeningInfo ticketOpeningInfo);
+
 
     /**
      * 添加对接联系人信息
@@ -19,7 +58,7 @@ public interface CustomerBasicInfoSaveService {
      * @param dockedContactInfo
      * @return
      */
-    public void saveDockedContactInfo(DockedContactInfo dockedContactInfo);
+    /*public void saveDockedContactInfo(DockedContactInfo dockedContactInfo);*/
 
     /**
      * 添加客户销售渠道备案信息
@@ -27,7 +66,7 @@ public interface CustomerBasicInfoSaveService {
      * @param channelSaleInfo
      * @return
      */
-    public void saveChannelSaleInfo(ChannelSaleInfo channelSaleInfo);
+    /*public void saveChannelSaleInfo(ChannelSaleInfo channelSaleInfo);*/
 
     /**
      * 添加付款/退款信息
@@ -35,7 +74,7 @@ public interface CustomerBasicInfoSaveService {
      * @param billingInfo
      * @return
      */
-    public void saveBillingInfo(BillingInfo billingInfo);
+    /*public void saveBillingInfo(BillingInfo billingInfo);*/
 
     /**
      * 添加对开票信息
@@ -43,5 +82,5 @@ public interface CustomerBasicInfoSaveService {
      * @param ticketOpeningInfo
      * @return
      */
-    public void saveTicketOpeningInfo(TicketOpeningInfo ticketOpeningInfo);
+    /*public void saveTicketOpeningInfo(TicketOpeningInfo ticketOpeningInfo);*/
 }

+ 57 - 6
watero-rst-service/src/main/java/com/iamberry/rst/service/customer/CustomerBasicInfoSaveServiceImpl.java

@@ -2,30 +2,81 @@ package com.iamberry.rst.service.customer;
 
 import com.iamberry.rst.core.customer.*;
 import com.iamberry.rst.faces.customer.CustomerBasicInfoSaveService;
+import com.iamberry.rst.service.customer.mapper.CustomerBasicInfoSaveMapper;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.List;
 
 public class CustomerBasicInfoSaveServiceImpl implements CustomerBasicInfoSaveService {
-    @Override
-    public void saveCustomerBasicInfo(CustomerBasicInfo customerBasicInfo) {
 
+    @Autowired
+    private CustomerBasicInfoSaveMapper customerBasicInfoSaveMapper;
+
+
+    @Override
+    public CustomerBasicInfo queryCustomerBasicInfoByCustomerId(int queryCustomerId) {
+        return null;
     }
 
     @Override
-    public void saveDockedContactInfo(DockedContactInfo dockedContactInfo) {
+    public List<DockedContactInfo> queryDockedContactInfoListByCustomerId(int queryCustomerId) {
+        return null;
+    }
 
+    @Override
+    public List<ChannelSaleInfo> queryChannelSaleInfoListByCustomerId(int queryCustomerId) {
+        return null;
     }
 
     @Override
-    public void saveChannelSaleInfo(ChannelSaleInfo channelSaleInfo) {
+    public BillingInfo queryBillingInfoByCustomerId(int queryCustomerId) {
+        return null;
+    }
 
+    @Override
+    public TicketOpeningInfo queryTicketOpeningInfoByCustomerId(int queryCustomerId) {
+        return null;
     }
 
     @Override
-    public void saveBillingInfo(BillingInfo billingInfo) {
+    @Transactional
+    public void saveCustomerBasicInfo(CustomerBasicInfo customerBasicInfo,DockedContactInfo dockedContactInfo, ChannelSaleInfo channelSaleInfo,
+                                     BillingInfo billingInfo, TicketOpeningInfo ticketOpeningInfo) {
+        int customerId = -1;
+        customerBasicInfo = customerBasicInfoSaveMapper.saveCustomerBasicInfo(customerBasicInfo);
+        if(customerBasicInfo != null){
+            customerId = customerBasicInfo.getCustomerId();
+            if(customerId != -1){
+                dockedContactInfo.setCustomerId(customerId);
+                channelSaleInfo.setCustomerId(customerId);
+                billingInfo.setCustomerId(customerId);
+                ticketOpeningInfo.setCustomerId(customerId);
+            }
+            customerBasicInfoSaveMapper.saveDockedContactInfo(dockedContactInfo);
+            customerBasicInfoSaveMapper.saveChannelSaleInfo(channelSaleInfo);
+            customerBasicInfoSaveMapper.saveBillingInfo(billingInfo);
+            customerBasicInfoSaveMapper.saveTicketOpeningInfo(ticketOpeningInfo);
+        }
+    }
 
+    /*@Override
+    public void saveDockedContactInfo(DockedContactInfo dockedContactInfo) {
+        customerBasicInfoSaveMapper.saveDockedContactInfo(dockedContactInfo);
     }
 
     @Override
-    public void saveTicketOpeningInfo(TicketOpeningInfo ticketOpeningInfo) {
+    public void saveChannelSaleInfo(ChannelSaleInfo channelSaleInfo) {
+        customerBasicInfoSaveMapper.saveChannelSaleInfo(channelSaleInfo);
+    }
 
+    @Override
+    public void saveBillingInfo(BillingInfo billingInfo) {
+        customerBasicInfoSaveMapper.saveBillingInfo(billingInfo);
     }
+
+    @Override
+    public void saveTicketOpeningInfo(TicketOpeningInfo ticketOpeningInfo) {
+        customerBasicInfoSaveMapper.saveTicketOpeningInfo(ticketOpeningInfo);
+    }*/
 }

+ 41 - 2
watero-rst-service/src/main/java/com/iamberry/rst/service/customer/mapper/CustomerBasicInfoSaveMapper.java

@@ -2,6 +2,8 @@ package com.iamberry.rst.service.customer.mapper;
 
 import com.iamberry.rst.core.customer.*;
 
+import java.util.List;
+
 public interface CustomerBasicInfoSaveMapper {
     /**
      * 添加客户基本信息
@@ -9,7 +11,7 @@ public interface CustomerBasicInfoSaveMapper {
      * @param customerBasicInfo
      * @return
      */
-    public int saveCustomerBasicInfo(CustomerBasicInfo customerBasicInfo);
+    public CustomerBasicInfo saveCustomerBasicInfo(CustomerBasicInfo customerBasicInfo);
 
     /**
      * 添加对接联系人信息
@@ -36,10 +38,47 @@ public interface CustomerBasicInfoSaveMapper {
     public void saveBillingInfo(BillingInfo billingInfo);
 
     /**
-     * 添加开票信息
+     * 添加开票信息
      *
      * @param ticketOpeningInfo
      * @return
      */
     public void saveTicketOpeningInfo(TicketOpeningInfo ticketOpeningInfo);
+
+    //查询部分 start
+    /**
+     * 根据客户id查询客户基本信息
+     * @param queryCustomerId
+     * @return
+     */
+    public CustomerBasicInfo queryCustomerBasicInfoByCustomerId(int queryCustomerId);
+
+    /**
+     * 根据客户id查询对接联系人信息
+     * @param queryCustomerId
+     * @return
+     */
+    public List<DockedContactInfo> queryDockedContactInfoListByCustomerId(int queryCustomerId);
+
+    /**
+     * 根据客户id查询客户销售渠道备案信息
+     * @param queryCustomerId
+     * @return
+     */
+    public List<ChannelSaleInfo> queryChannelSaleInfoListByCustomerId(int queryCustomerId);
+
+    /**
+     * 根据客户id查询客户付款/退款信息
+     * @param queryCustomerId
+     * @return
+     */
+    public BillingInfo queryBillingInfoByCustomerId(int queryCustomerId);
+
+    /**
+     * 根据客户id查询客户开票信息
+     * @param queryCustomerId
+     * @return
+     */
+    public TicketOpeningInfo queryTicketOpeningInfoByCustomerId(int queryCustomerId);
+    //查询部分 end
 }

+ 129 - 1
watero-rst-service/src/main/java/com/iamberry/rst/service/customer/mapper/CustomerBasicInfoSaveMapper.xml

@@ -1,8 +1,68 @@
 <?xml version="1.0" encoding="UTF-8" ?>
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
 <mapper namespace="com.iamberry.rst.service.customer.mapper.CustomerBasicInfoSaveMapper" >
+    <!--映射结果集 start-->
+    <!--客户基本信息结果映射-->
+    <resultMap type="com.iamberry.rst.core.customer.CustomerBasicInfo" id="customerBasicInfoResult">
+        <id property="customerId" column="customer_id"/>
+        <result property="customerName" column="customer_name" />
+        <result property="customerIndustry" column="customer_industry" />
+        <result property="customerType" column="customer_type" />
+        <result property="cooperativeState" column="cooperative_state" />
+        <result property="customerProvinceCode" column="customer_province_code" />
+        <result property="customerCityCode" column="customer_city_code" />
+        <result property="customerAddress" column="customer_address" />
+        <result property="customerStatus" column="customer_status" />
+        <result property="createDate" column="create_date" />
+        <result property="updateDate" column="update_date" />
+        <result property="idCreateBy" column="id_create_by" />
+        <result property="customerRemarks" column="customer_remarks" />
+    </resultMap>
+    <!--对接联系人信息结果映射-->
+    <resultMap type="com.iamberry.rst.core.customer.DockedContactInfo" id="dockedContactInfoResult">
+        <id property="dockedContactId" column="docked_contact_id"/>
+        <result property="contactName" column="contact_name" />
+        <result property="contactPhone" column="contact_phone" />
+        <result property="contactType" column="contact_type" />
+        <result property="contactEmail" column="contact_email" />
+        <result property="createDate" column="create_date" />
+    </resultMap>
+    <!--客户渠道销售信息结果映射-->
+    <resultMap type="com.iamberry.rst.core.customer.ChannelSaleInfo" id="channelSaleInfoResult">
+        <id property="channelSaleId" column="channel_sale_id"/>
+        <result property="channelName" column="channel_name" />
+        <result property="promotingProducts" column="promoting_products" />
+        <result property="supplyPrice" column="supply_price" />
+        <result property="accountPeriod" column="account_period" />
+        <result property="createDate" column="create_date" />
+    </resultMap>
+    <!--付款/退款信息结果映射-->
+    <resultMap type="com.iamberry.rst.core.customer.BillingInfo" id="billingInfoResult">
+        <id property="billingId" column="billing_id"/>
+        <result property="accountOpeningBranch" column="account_opening_branch" />
+        <result property="accountName" column="account_name" />
+        <result property="accountNum" column="account_num" />
+        <result property="receivablesName" column="receivables_name" />
+        <result property="receivablesPhone" column="receivables_phone" />
+        <result property="createDate" column="create_date" />
+    </resultMap>
+    <!--开票信息结果映射-->
+    <resultMap type="com.iamberry.rst.core.customer.TicketOpeningInfo" id="ticketOpeningInfoResult">
+        <id property="ticketOpeningId" column="ticket_opening_id"/>
+        <result property="ticketType" column="ticket_type" />
+        <result property="accountOpeningBranch" column="account_opening_branch" />
+        <result property="ticketOpeningAccount" column="ticket_opening_account" />
+        <result property="enterpriseName" column="enterprise_name" />
+        <result property="taxpayerIdentificationNum" column="taxpayer_identification_num" />
+        <result property="ticketOpeningPhone" column="ticket_opening_phone" />
+        <result property="enterpriseAddress" column="enterprise_address" />
+        <result property="createDate" column="create_date" />
+    </resultMap>
+    <!--映射结果集 end-->
+
+    <!--新增部分 start-->
     <!-- 添加客户基本信息 -->
-    <insert id="saveCustomerBasicInfo" parameterType="CustomerBasicInfo">
+    <insert id="saveCustomerBasicInfo" parameterType="CustomerBasicInfo" useGeneratedKeys="true"  keyProperty="customer_id">
         INSERT INTO
         tb_rst_customer_basic_info
         (
@@ -69,4 +129,72 @@
         #{taxpayerIdentificationNum},#{ticketOpeningPhone},#{enterpriseAddress},NOW()
         )
     </insert>
+    <!--新增部分 end-->
+
+    <!--查询部分 start-->
+    <!-- 根据客户id查询客户基本信息 -->
+    <select id="queryCustomerBasicInfoByCustomerId" parameterType="Integer" resultMap="customerBasicInfoResult">
+        SELECT * FROM tb_rst_customer_basic_info t WHERE t.customer_id = #{id}
+    </select>
+    <!-- 根据客户id查询对接联系人信息 -->
+    <select id="queryDockedContactInfoListByCustomerId" parameterType="Integer" resultMap="dockedContactInfoResult">
+        SELECT
+          t.docked_contact_id,
+          t.contact_name,
+          t.contact_phone,
+          t.contact_type,
+          t.contact_email,
+          t.create_date
+        FROM
+          tb_rst_docked_contact_info t
+        WHERE
+          t.customer_id = #{id}
+    </select>
+    <!-- 根据客户id查询客户销售渠道备案信息 -->
+    <select id="queryChannelSaleInfoListByCustomerId" parameterType="Integer" resultMap="channelSaleInfoResult">
+        SELECT
+        t.channel_sale_id,
+        t.channel_name,
+        t.promoting_products,
+        t.supply_price,
+        t.account_period,
+        t.create_date
+        FROM
+        tb_rst_ channel_sale_info t
+        WHERE
+        t.customer_id = #{id}
+    </select>
+    <!-- 根据客户id查询客户付款/退款信息 -->
+    <select id="queryBillingInfoByCustomerId" parameterType="Integer" resultMap="billingInfoResult">
+        SELECT
+        t.billing_id,
+        t.account_opening_branch,
+        t.account_name,
+        t.account_num,
+        t.receivables_name,
+        t.receivables_phone,
+        t.create_date
+        FROM
+        tb_rst_billing_info t
+        WHERE
+        t.customer_id = #{id}
+    </select>
+    <!-- 根据客户id查询客户开票信息 -->
+    <select id="queryTicketOpeningInfoByCustomerId" parameterType="Integer" resultMap="ticketOpeningInfoResult">
+        SELECT
+        t.ticket_opening_id,
+        t.ticket_type,
+        t.account_opening_branch,
+        t.ticket_opening_account,
+        t.enterprise_name,
+        t.taxpayer_identification_num,
+        t.ticket_opening_phone,
+        t.enterprise_address,
+        t.create_date
+        FROM
+        tb_rst_ticket_opening_info t
+        WHERE
+        t.customer_id = #{id}
+    </select>
+    <!--查询部分 end-->
 </mapper>

+ 61 - 328
watero-rst-web/src/main/java/com/iamberry/rst/controllers/customer/CustomerBasicInfoSaveController.java

@@ -1,22 +1,9 @@
 package com.iamberry.rst.controllers.customer;
 
-import com.iamberry.rst.controllers.cm.AdminCustomerController;
-import com.iamberry.rst.core.cm.*;
-import com.iamberry.rst.core.order.ProductType;
-import com.iamberry.rst.core.sys.Admin;
-import com.iamberry.rst.faces.address.AddressService;
-import com.iamberry.rst.faces.cm.*;
-import com.iamberry.rst.faces.customer.CustomerBasicService;
-import com.iamberry.rst.faces.order.EfastOrderService;
-import com.iamberry.rst.faces.product.ProductService;
-import com.iamberry.rst.faces.sms.SmsService;
-import com.iamberry.rst.faces.sys.SysService;
-import com.iamberry.rst.util.CustomerCommonUtil;
-import com.iamberry.rst.util.SmsConfig;
-import com.iamberry.rst.utils.AdminUtils;
-import com.iamberry.rst.utils.OrderNoUtil;
+import com.iamberry.rst.core.customer.*;
+import com.iamberry.rst.faces.customer.CustomerBasicInfoSaveService;
 import com.iamberry.wechat.tools.ResponseJson;
-import net.sf.json.JSONArray;
+import org.apache.commons.lang.StringUtils;
 import org.apache.shiro.authz.annotation.RequiresPermissions;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -25,73 +12,26 @@ import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.ResponseBody;
 import org.springframework.web.servlet.ModelAndView;
-
 import javax.servlet.http.HttpServletRequest;
 import java.util.ArrayList;
 import java.util.List;
 
+
 @Controller
 @RequestMapping("/admin/CustomerBasic")
 public class CustomerBasicInfoSaveController {
 
     private Logger logger = LoggerFactory.getLogger(CustomerBasicInfoSaveController.class);
+
     @Autowired
-    private CustomerBasicService customerBasicService;
-    @Autowired
-    private CompanyInfoService companyInfoService;
-    @Autowired
-    private StoreInfoService storeInfoService;
-    @Autowired
-    private SalesOrderService salesOrderService;
-    @Autowired
-    private CustomerService customerService;
-    @Autowired
-    private ProductService productService;
-    @Autowired
-    private SysService sysService;
-    @Autowired
-    private ComplaintTypeInfoService complaintTypeInfoService;
-    @Autowired
-    private VisitService visitService;
-    @Autowired
-    private QuestionDescribeService questionDescribeService;
-    @Autowired
-    private RenewedService renewedService;
-    @Autowired
-    private RepairService repairService;
-    @Autowired
-    private BackGoodsService backGoodsService;
-    @Autowired
-    private FittingsInfoService fittingsInfoService;
-    @Autowired
-    private ReissueService reissueService;
-    @Autowired
-    private NoreasonBackService noreasonBackService;
-    @Autowired
-    private ComplaintQuestionInfoService complaintQuestionInfoService;
-    @Autowired
-    private SmsService smsService;
-    @Autowired
-    private ComplaintSignclosedInfoService complaintSignclosedInfoService;
-    @Autowired
-    private ComplaintSmallClassInfoService complaintSmallClassInfoService;
-    @Autowired
-    private CustomerCommonService customerCommonService;
-    @Autowired
-    private AddressService addressService;
-    @Autowired
-    private PostageService postageService;
-    @Autowired
-    private EfastOrderService efastOrderService;
-    @Autowired
-    private RelationOrderService relationOrderService;
+    private CustomerBasicInfoSaveService customerBasicInfoSaveService;
 
     /**
      * 跳转到添加客户信息页面
      *
      * @return
      */
-    @RequiresPermissions("customer:add:customer")
+    @RequiresPermissions("customer:add:customerInfo")
     @RequestMapping(value = "/save_customer_info")
     public ModelAndView toAddCustomer(HttpServletRequest request) {
         ModelAndView mv = new ModelAndView("customerInfoAdmin/save_customer_info");
@@ -101,301 +41,94 @@ public class CustomerBasicInfoSaveController {
     /**
      * 添加客户信息
      * @param request
-     * @param customerInfo
-     * @param salesOrder
-     * @param customerCommon
-     * @param sendProdcuesJson
-     * @param sendFittingsJson
-     * @param closedProdcuesJson
-     * @param closedFittingsJson
+     * @param customerBasicInfo
+     * @param dockedContactInfo
+     * @param channelSaleInfo
+     * @param billingInfo
+     * @param ticketOpeningInfo
      * @return
      * @throws Exception
      */
     @ResponseBody
-    @RequiresPermissions("customer:add:customer")
+    @RequiresPermissions("customer:add:customerInfo")
     @RequestMapping("/save_customer")
-    public ResponseJson addCustomer(HttpServletRequest request, CustomerInfo customerInfo, SalesOrder salesOrder, CustomerCommon customerCommon,
-                                    String sendProdcuesJson, String sendFittingsJson, String closedProdcuesJson, String closedFittingsJson) throws Exception {
-        ResponseJson rjx = this.isValiData(customerInfo);
+    public ResponseJson saveCustomerBasicInfo(HttpServletRequest request, CustomerBasicInfo customerBasicInfo, DockedContactInfo dockedContactInfo, ChannelSaleInfo channelSaleInfo,
+                                    BillingInfo billingInfo, TicketOpeningInfo ticketOpeningInfo) throws Exception {
+        //注意:DockedContactInfo、ChannelSaleInfo可能为多个,需修改
+        ResponseJson rjx = this.isValiData(customerBasicInfo);
+        Boolean isSaveSuccess = false;//是否保存成功标识
         if(rjx.getResultCode() == 500){
             return rjx;
         }
-
-        Integer customerIsSolve = customerInfo.getCustomerIsSolve();    //处理类型
-        String phone = customerInfo.getCustomerTel();       //手机号码
-        Integer typeCompany = customerInfo.getTypeCompany();    // 所属商城   1:美国watero; 2:上朵电动牙刷  3:优尼雅净水机
-
-        Integer flag = 0;
-        if(customerInfo.getIsNeedSelectOrder() == 1){ ////1:需要有订单    2:不需要有订单
-            JSONArray jsonArray;
-            List<SendProdcue> sendProdcueList;
-            List<SendFitting> sendFittingList;
-            List<ClosedProdcue> closedProdcueList;
-            List<ClosedFitting> closedFittingList;
-
-            jsonArray = JSONArray.fromObject(sendProdcuesJson);
-            sendProdcueList = (List) JSONArray.toCollection(jsonArray, SendProdcue.class);
-
-            jsonArray = JSONArray.fromObject(sendFittingsJson);
-            sendFittingList = (List) JSONArray.toCollection(jsonArray, SendFitting.class);
-
-            jsonArray = JSONArray.fromObject(closedProdcuesJson);
-            closedProdcueList = (List) JSONArray.toCollection(jsonArray, ClosedProdcue.class);
-
-            jsonArray = JSONArray.fromObject(closedFittingsJson);
-            closedFittingList = (List) JSONArray.toCollection(jsonArray, ClosedFitting.class);
-
-            customerCommon.setSendProdcues(sendProdcueList);
-            customerCommon.setSendFittings(sendFittingList);
-            customerCommon.setClosedProdcues(closedProdcueList);
-            customerCommon.setClosedFittings(closedFittingList);
-        }
-
-        customerInfo.setCustomerCommon(customerCommon);
-        String orderId = "";
-        if (customerInfo.getCustomerIsSolve() == 3 || customerInfo.getCustomerIsSolve() == 4 || customerInfo.getCustomerIsSolve() == 5) {
-            Integer adminId = AdminUtils.getLoginAdminId();
-            orderId = OrderNoUtil.createOrderCode(adminId);
-        }
-        customerInfo.setTransactionNumber(orderId);
-
-        Integer customerId = customerInfo.getCustomerId();
-        logger.info("-----------------添加客诉开始----------------------");
+        logger.info("-----------------添加客户信息开始----------------------");
         try {
-            flag = customerService.saveCustomerInfo(customerInfo, salesOrder);
+            customerBasicInfoSaveService.saveCustomerBasicInfo(customerBasicInfo,dockedContactInfo,channelSaleInfo,billingInfo,ticketOpeningInfo);
+            isSaveSuccess = true;
         } catch (RuntimeException e) {
+            isSaveSuccess = false;
             return new ResponseJson(500, e.getMessage(), 500);
         }
-        customerId = customerInfo.getCustomerId();
-        logger.info("-----------------添加客诉结束----------------------");
-        if (flag < 1) {
-            return new ResponseJson(500, "添加客诉失败!", 500);
+        logger.info("-----------------添加客户信息结束----------------------");
+        if (!isSaveSuccess) {
+            return new ResponseJson(500, "添加客户信息失败!", 500);
+        }else{
+            return new ResponseJson(200, "添加客户信息成功!", 200);
         }
-        String msg = "";
-        //处理结果: 1:已解决  2:未解决 3:换新  4:维修 5:补发 6:退货 7:无理由退货
-        if (customerIsSolve == 3 || customerIsSolve == 4 || customerIsSolve == 5 || customerIsSolve == 6 || customerIsSolve == 7) {
-            String solveMsg = "";
-            switch (customerIsSolve) {
-                case 3:
-                    solveMsg = "为您更换新机";
-                    break;
-                case 4:
-                    solveMsg = "为您维修机器";
-                    break;
-                case 5:
-                    solveMsg = "为您补发产品";
-                    break;
-                case 6:
-                    solveMsg = "为您办理退货";
-                    break;
-                case 7:
-                    solveMsg = "为您办理退货";
-                    break;
-            }
-
-            String addCustomerSuccessMsg = "";
-            String typeMsg = "";
-            switch (typeCompany) {
-                case 1:
-                    addCustomerSuccessMsg = SmsConfig.ADD_CUSTOMER_SUCCESS_WATERO;
-                    typeMsg = "美国WaterO售后";
-                    break;
-                case 2:
-                    addCustomerSuccessMsg = SmsConfig.ADD_CUSTOMER_SUCCESS_SHANGDUO;
-                    typeMsg = "上朵售后";
-                    break;
-                case 3:
-                    addCustomerSuccessMsg = SmsConfig.ADD_CUSTOMER_SUCCESS_YULIA;
-                    typeMsg = "YULIA售后";
-                    break;
-                case 4:
-                    addCustomerSuccessMsg = SmsConfig.ADD_CUSTOMER_SUCCESS_AIBERLE;
-                    typeMsg = "爱贝源售后";
-                    break;
-            }
-            msg = ",请前往Efast进行换货/退货操作。";
-        }
-        return new ResponseJson(200, "录入客诉成功!客诉编号:" + customerId + msg, 200);
     }
 
-
     /**
      * 跳转到修改客户信息页面
      *
      * @return
      */
-    @RequiresPermissions("customer:update:customer")
+    @RequiresPermissions("customer:update:customerInfo")
     @RequestMapping(value = "/update_customer_info")
-    public ModelAndView updateCustomerInfo(HttpServletRequest request,Integer customerId) {
+    public ModelAndView updateCustomerInfo(HttpServletRequest request) throws Exception{
         ModelAndView mv = new ModelAndView("customerInfoAdmin/update_customer_info");
-
-        ProductType productType = new ProductType();
-        //查询产品类型集合
-        List<ProductType> typeList = productService.listProductType(productType);
-        //查询客诉类型集合
-        List<ComplaintTypeInfo> complaintTypeList = complaintTypeInfoService.listComplaintTypeInfo(new ComplaintTypeInfo());
-        //查询跟进客服集合
-        Admin admin = new Admin();
-        admin.setAdminDept(3);
-        admin.setAdminStatus(1);
-        List<Admin> adminList = sysService.listSelectAdmin(admin);
-        //获取登录人id
-        Integer loginAdminId = AdminUtils.getLoginAdminId();
-        //查询客诉基本信息
-        CustomerInfo customerInfo = customerService.getCustomerInfo(customerId);
-        /*客诉信息处理-stast*/
-        //对于区域处理
-        if(customerInfo!=null && customerInfo.getCustomerArea() != null){
-//            String[] customerAreaAndCity = customerInfo.getCustomerArea().split("-");
-//            customerInfo.setProvinceName(customerAreaAndCity[0]);
-//            City city
-//            addressService.listCity(customerAreaAndCity[0]);
-//            customerInfo.setCityName(customerAreaAndCity[0]);
+        String customerId = request.getParameter("customerId");
+        boolean isSuccess = false;
+        if (!StringUtils.isNotEmpty(customerId)) {
+            return mv;
         }
-        /*客诉信息处理-end*/
-        CustomerCommon customerCommon = new CustomerCommon();
-        if(customerInfo.getCustomerIsSolve() != null){
-            switch (customerInfo.getCustomerIsSolve()){   //处理结果: 1:已解决  2:未解决 3:换新  4:维修 5:补发 6:退货 7:无理由退货
-                case 3://获取换新
-                    Renewed renewed = new Renewed();
-                    renewed.setCustomerId(customerInfo.getCustomerId());
-                    renewed = renewedService.getRenewed(renewed);
-                    customerCommon = CustomerCommonUtil.getCustomerCommon(3,renewed);
-                    break;
-                case 4://维修
-                    Repair repair = new Repair();
-                    repair.setCustomerId(customerInfo.getCustomerId());
-                    repair = repairService.getRepair(repair);
-                    customerCommon = CustomerCommonUtil.getCustomerCommon(4,repair);
-                    break;
-                case 5:
-                    Reissue reissue = new  Reissue();
-                    reissue.setCustomerId(customerInfo.getCustomerId());
-                    reissue = reissueService.getReissue(reissue);
-                    customerCommon = CustomerCommonUtil.getCustomerCommon(5,reissue);
-                    break;
-                case 6:
-                    BackGoods backGoods = new  BackGoods();
-                    backGoods.setCustomerId(customerInfo.getCustomerId());
-                    backGoods = backGoodsService.getBackGoods(backGoods);
-                    customerCommon = CustomerCommonUtil.getCustomerCommon(6,backGoods);
-                    break;
-                case 7:
-                    NoreasonBack noreasonBack = new  NoreasonBack();
-                    noreasonBack.setCustomerId(customerInfo.getCustomerId());
-                    noreasonBack = noreasonBackService.getNoreasonBack(noreasonBack);
-                    customerCommon = CustomerCommonUtil.getCustomerCommon(7,noreasonBack);
-                    break;
-            }
-
-            /*查询所有需要寄入寄出的产品*/
-            customerCommon.setCustomerIsSolve(customerInfo.getCustomerIsSolve());
-            customerCommon = customerCommonService.getListProduceAndFitting(customerCommon);
-
-            // 2018/4/18  页面只会给寄回的赋值,在处理方式为补发的情况下,寄出需要赋值到寄回当中
-            if(customerInfo.getCustomerIsSolve() == 5){
-                //售后寄回产品表
-                List<ClosedProdcue> closedProdcues = new ArrayList<ClosedProdcue>();
-                for (SendProdcue sendProdcue : customerCommon.getSendProdcues()) {
-                    ClosedProdcue closedProdcue = new ClosedProdcue();
-                    closedProdcue.setRelationId(sendProdcue.getRelationId());
-                    closedProdcue.setProductType(sendProdcue.getProductType());
-                    closedProdcue.setProductId(sendProdcue.getProductId());
-                    closedProdcue.setColorId(sendProdcue.getColorId());
-                    closedProdcue.setClosedProductName(sendProdcue.getSendProduceName());
-                    closedProdcue.setClosedColorName(sendProdcue.getSendColorName());
-                    closedProdcue.setClosedProdcueNumber(sendProdcue.getSendProdcueNumber());
-                    closedProdcues.add(closedProdcue);
-                }
-                //售后寄回产品配件表
-                List<ClosedFitting> closedFittings = new ArrayList<ClosedFitting>();
-                for (SendFitting sendFitting : customerCommon.getSendFittings()) {
-                    ClosedFitting closedFitting = new ClosedFitting();
-                    closedFitting.setRelationId(sendFitting.getRelationId());
-                    closedFitting.setClosedFittingType(sendFitting.getSendFittingType());
-                    closedFitting.setProductId(sendFitting.getProductId());
-                    closedFitting.setFittingsId(sendFitting.getFittingsId());
-                    closedFitting.setClosedProductName(sendFitting.getSendProductName());
-                    closedFitting.setClosedFittingsName(sendFitting.getSendFittingsName());
-                    closedFitting.setClosedFittingNumber(sendFitting.getSendFittingNumber());
-                    closedFittings.add(closedFitting);
-                }
-                customerCommon.setClosedProdcues(closedProdcues);
-                customerCommon.setClosedFittings(closedFittings);
-            }
-            mv.addObject("customerCommon", customerCommon);
-
-            if(customerInfo.getTypeId() == 1){
-                customerInfo.setIsNeedSelectOrder(2);       //不需要订单
-            }else{
-                customerInfo.setIsNeedSelectOrder(1);
-            }
-
-            if(customerInfo.getTypeId() != 1 && (customerInfo.getCustomerIsSolve() == 3 || customerInfo.getCustomerIsSolve() == 4 || customerInfo.getCustomerIsSolve() == 5 ||
-                    customerInfo.getCustomerIsSolve() == 6 || customerInfo.getCustomerIsSolve() == 7)){
-                RelationOrder relationOrder = new RelationOrder();
-                relationOrder.setRelationType(customerCommon.getCustomerIsSolve());
-                relationOrder.setRelationId(customerCommon.getRelationId());
-                List<RelationOrder> relationOrderList = relationOrderService.getRelationOrderList(relationOrder);
-
-                String[] salesIds = new String[relationOrderList.size()];
-                for (int k=0; k<relationOrderList.size();k++){
-                    salesIds[k] = String.valueOf(relationOrderList.get(k).getSalesId());
-                }
-                SalesOrder so = new SalesOrder();
-                so.setSalesIds(salesIds);
-                List<SalesOrder> orderList = salesOrderService.listSalesOrder(so);
-                for (SalesOrder sor: orderList) {
-                    SalesOrderItem salesOrderItem = new SalesOrderItem();
-                    salesOrderItem.setItemOrderId(sor.getSalesId());
-                    List<SalesOrderItem> salesOrderItemList = salesOrderService.listSalesOrderItem(salesOrderItem);
-                    sor.setSalesOrderItemList(salesOrderItemList);
-                }
-                mv.addObject("salesOrderList", orderList);
-            }else{
-                mv.addObject("salesOrderList", null);
-            }
+        int queryCustomerId = Integer.valueOf(customerId);
+        CustomerBasicInfo customerBasicInfo = new CustomerBasicInfo();
+        List<DockedContactInfo> dockedContactInfoList = new ArrayList<DockedContactInfo>();
+        List<ChannelSaleInfo> channelSaleInfoList = new ArrayList<ChannelSaleInfo>();
+        BillingInfo billingInfo = new BillingInfo();
+        TicketOpeningInfo ticketOpeningInfo = new TicketOpeningInfo();
+        try {
+            customerBasicInfo = customerBasicInfoSaveService.queryCustomerBasicInfoByCustomerId(queryCustomerId);
+            dockedContactInfoList = customerBasicInfoSaveService.queryDockedContactInfoListByCustomerId(queryCustomerId);
+            channelSaleInfoList = customerBasicInfoSaveService.queryChannelSaleInfoListByCustomerId(queryCustomerId);
+            billingInfo = customerBasicInfoSaveService.queryBillingInfoByCustomerId(queryCustomerId);
+            ticketOpeningInfo = customerBasicInfoSaveService.queryTicketOpeningInfoByCustomerId(queryCustomerId);
+            isSuccess = true;
+        }catch (Exception e){
+            isSuccess = false;
+            logger.error("跳转修改页面失败:"+e.getMessage());
         }
-        if ("2".equals(customerInfo.getCustomerIsVisit())){ //1:不需要回访  2:需要回访
-            Visit visit = new Visit();
-            visit.setCustomerId(customerInfo.getCustomerId());
-            visit = visitService.getVisit(visit);
-            mv.addObject("visit", visit);
+        if(!isSuccess){
+            return mv;
+        }else{
+            mv.addObject("customerBasicInfo", customerBasicInfo);
+            mv.addObject("dockedContactInfoList", dockedContactInfoList);
+            mv.addObject("channelSaleInfoList", channelSaleInfoList);
+            mv.addObject("billingInfo", billingInfo);
+            mv.addObject("ticketOpeningInfo", ticketOpeningInfo);
         }
-
-        //查询关联问题
-        ComplaintQuestionInfo complaintQuestionInfo = complaintQuestionInfoService.getQuestionById(customerInfo.getQuestionId());
-        //查询问题小类
-        ComplaintSmallClassInfo complaintSmallClassInfo = new ComplaintSmallClassInfo();
-        complaintSmallClassInfo.setComplaintId(complaintQuestionInfo.getComplaintId());
-        List<ComplaintSmallClassInfo> complaintSmallClassInfoList = complaintSmallClassInfoService.listComplaintSmallClassInfo(complaintSmallClassInfo);
-        //查询问题大类
-        ComplaintTypeInfo complaintTypeInfo = new ComplaintTypeInfo();
-        List<ComplaintTypeInfo> complaintTypeInfoList = complaintTypeInfoService.listComplaintTypeInfo(complaintTypeInfo);
-        mv.addObject("customerInfo", customerInfo);
-        mv.addObject("typeList", typeList);
-        mv.addObject("complaintTypeList", complaintTypeList);
-        mv.addObject("complaintTypeList", complaintTypeList);
-        mv.addObject("adminList", adminList);
-        mv.addObject("loginAdminId", loginAdminId);
-        mv.addObject("complaintQuestionInfo", complaintQuestionInfo);
-        mv.addObject("complaintSmallClassInfoList", complaintSmallClassInfoList);
-        mv.addObject("complaintTypeInfoList", complaintTypeInfoList);
         return mv;
     }
 
-
-    //方法
     /**
      * 验证方法
      *
-     * @param customerInfo
+     * @param customerBasicInfo
      * @return
      */
-    public ResponseJson isValiData(CustomerInfo customerInfo) {
+    public ResponseJson isValiData(CustomerBasicInfo customerBasicInfo) {
         ResponseJson rj = new ResponseJson();
-        if(customerInfo.getAdminId() == null){
-            return new ResponseJson(500, "未填写客诉id", 500);
+        if(customerBasicInfo == null){
+            return new ResponseJson(500, "未填写客户基本信息", 500);
         }
         return rj;
     }