浏览代码

添加客诉回访信息

liuzhiwei 7 年之前
父节点
当前提交
bb6af329b1

+ 27 - 0
watero-rst-core/src/main/java/com.iamberry.rst.core/cm/CustomerInfo.java

@@ -49,6 +49,7 @@ public class CustomerInfo  implements Serializable {
 
     private String productName;         //客诉产品
     private String complaintClassName;  //客诉类型名称
+    private Integer complaintId;        //客诉类型id
     private String smallClassName;      //客诉小类名称
     private String describeTitle;       //客诉问题标题
     private String companyName;         //销售公司名称
@@ -60,6 +61,32 @@ public class CustomerInfo  implements Serializable {
     private Date salesTime;             //购买日期
     private Integer backStatus;         //寄回状态
     private Integer sendStatus;         //寄送状态
+    private Integer visitStatus;        //回访状态
+    private Date visitCompleteDate;     //回访完成时间
+
+    public Integer getVisitStatus() {
+        return visitStatus;
+    }
+
+    public void setVisitStatus(Integer visitStatus) {
+        this.visitStatus = visitStatus;
+    }
+
+    public Date getVisitCompleteDate() {
+        return visitCompleteDate;
+    }
+
+    public void setVisitCompleteDate(Date visitCompleteDate) {
+        this.visitCompleteDate = visitCompleteDate;
+    }
+
+    public Integer getComplaintId() {
+        return complaintId;
+    }
+
+    public void setComplaintId(Integer complaintId) {
+        this.complaintId = complaintId;
+    }
 
     public Integer getBackStatus() {
         return backStatus;

+ 21 - 14
watero-rst-core/src/main/java/com.iamberry.rst.core/cm/Visit.java

@@ -1,8 +1,14 @@
 package com.iamberry.rst.core.cm;
 
+import com.fasterxml.jackson.annotation.JsonFormat;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.io.Serializable;
 import java.util.Date;
 
-public class Visit {
+public class Visit implements Serializable {
+
+    private static final long serialVersionUID = 2472568693811968905L;
     private Integer visitId;
 
     private Integer customerId;
@@ -12,12 +18,13 @@ public class Visit {
     private String visitName;
 
     private String visitTel;
-
+    @DateTimeFormat(pattern="yyyy-MM-dd")
+    @JsonFormat(pattern="yyyy-MM-dd",timezone = "GMT+8")
     private Date visitDate;
 
-    private Boolean visitTimeSelect;
+    private Integer visitTimeSelect;
 
-    private Byte visitStatus;
+    private Integer visitStatus;
 
     private Date visitCompleteDate;
 
@@ -79,19 +86,11 @@ public class Visit {
         this.visitDate = visitDate;
     }
 
-    public Boolean getVisitTimeSelect() {
-        return visitTimeSelect;
-    }
-
-    public void setVisitTimeSelect(Boolean visitTimeSelect) {
-        this.visitTimeSelect = visitTimeSelect;
-    }
-
-    public Byte getVisitStatus() {
+    public Integer getVisitStatus() {
         return visitStatus;
     }
 
-    public void setVisitStatus(Byte visitStatus) {
+    public void setVisitStatus(Integer visitStatus) {
         this.visitStatus = visitStatus;
     }
 
@@ -142,4 +141,12 @@ public class Visit {
     public void setVisitUpdateTime(Date visitUpdateTime) {
         this.visitUpdateTime = visitUpdateTime;
     }
+
+    public Integer getVisitTimeSelect() {
+        return visitTimeSelect;
+    }
+
+    public void setVisitTimeSelect(Integer visitTimeSelect) {
+        this.visitTimeSelect = visitTimeSelect;
+    }
 }

+ 14 - 0
watero-rst-interface/src/main/java/com/iamberry/rst/faces/cm/CustomerService.java

@@ -11,6 +11,20 @@ import java.util.List;
 public interface CustomerService {
 
     /**
+     * 根据id获取客诉信息
+     * @param customerId
+     * @return
+     */
+    CustomerInfo getCustomerInfo(Integer customerId);
+
+    /**
+     * 修改客诉信息
+     * @param record
+     * @return
+     */
+    Integer updateCustomerInfo(CustomerInfo record);
+
+    /**
      *  查询客诉基本信息列表
      * @param customerInfo
      * @return

+ 16 - 0
watero-rst-interface/src/main/java/com/iamberry/rst/faces/cm/VisitService.java

@@ -0,0 +1,16 @@
+package com.iamberry.rst.faces.cm;
+
+import com.iamberry.rst.core.cm.Visit;
+
+/**
+ * Created by liuzhiwei on 2017/11/3.
+ */
+public interface VisitService {
+
+    /**
+     * 添加客诉回访信息
+     * @param visit
+     * @return
+     */
+    Integer addVisitInfo(Visit visit);
+}

+ 10 - 0
watero-rst-service/src/main/java/com/iamberry/rst/service/cm/CustomerServiceImpl.java

@@ -29,6 +29,16 @@ public class CustomerServiceImpl implements CustomerService {
     private RenewedMapper renewedMapper;
 
     @Override
+    public CustomerInfo getCustomerInfo(Integer customerId) {
+        return customerInfoMapper.getCustomerInfo(customerId);
+    }
+
+    @Override
+    public Integer updateCustomerInfo(CustomerInfo record) {
+        return customerInfoMapper.updateCustomerInfo(record);
+    }
+
+    @Override
     public PagedResult<CustomerInfo> listCustomer(int pageNO, int pageSize, CustomerInfo customerInfo, boolean isTotalNum) {
         PageHelper.startPage(pageNO, pageSize, isTotalNum);
         //查询客诉列表

+ 23 - 0
watero-rst-service/src/main/java/com/iamberry/rst/service/cm/VisitServiceImpl.java

@@ -0,0 +1,23 @@
+package com.iamberry.rst.service.cm;
+
+import com.iamberry.rst.core.cm.Visit;
+import com.iamberry.rst.faces.cm.VisitService;
+import com.iamberry.rst.service.cm.mapper.VisitMapper;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+/**
+ * 客诉回访service
+ * Created by liuzhiwei on 2017/11/3.
+ */
+@Service
+public class VisitServiceImpl implements VisitService {
+
+    @Autowired
+    private VisitMapper visitMapper;
+
+    @Override
+    public Integer addVisitInfo(Visit visit) {
+        return visitMapper.addVisitInfo(visit);
+    }
+}

+ 12 - 4
watero-rst-service/src/main/java/com/iamberry/rst/service/cm/mapper/CustomerInfoMapper.java

@@ -11,11 +11,19 @@ public interface CustomerInfoMapper {
 
     int insertSelective(CustomerInfo record);
 
-    CustomerInfo selectByPrimaryKey(Integer customerId);
-
-    int updateByPrimaryKeySelective(CustomerInfo record);
+    /**
+     * 根据id获取客诉信息
+     * @param customerId
+     * @return
+     */
+    CustomerInfo getCustomerInfo(Integer customerId);
 
-    int updateByPrimaryKey(CustomerInfo record);
+    /**
+     * 修改客诉信息
+     * @param record
+     * @return
+     */
+    Integer updateCustomerInfo(CustomerInfo record);
 
     /**
      *  查询客诉基本信息列表

+ 6 - 1
watero-rst-service/src/main/java/com/iamberry/rst/service/cm/mapper/VisitMapper.java

@@ -5,7 +5,12 @@ import com.iamberry.rst.core.cm.Visit;
 public interface VisitMapper {
     int deleteByPrimaryKey(Integer visitId);
 
-    int insert(Visit record);
+    /**
+     * 添加客诉回访信息
+     * @param visit
+     * @return
+     */
+    Integer addVisitInfo(Visit visit);
 
     int insertSelective(Visit record);
 

+ 45 - 162
watero-rst-service/src/main/java/com/iamberry/rst/service/cm/mapper/customerInfoMapper.xml

@@ -25,7 +25,9 @@
     customer_counsel_type, customer_name, customer_tel, customer_is_solve, customer_is_visit, 
     customer_in_TDS, customer_out_TDS, customer_area, customer_create_time, customer_update_time
   </sql>
-  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
+
+  <!-- 根据id获取客诉信息 -->
+  <select id="getCustomerInfo" resultType="CustomerInfo" parameterType="java.lang.Integer" >
     select 
     <include refid="Base_Column_List" />
     from tb_rst_customer_info
@@ -48,7 +50,7 @@
       c.customer_source customerSource,
       t.type_name typeName,
       ct.complaint_class_name complaintClassName,
-      sc.small_class_name smallClassName,
+      s.small_class_name smallClassName,
       d.describe_title describeTitle,
       sc.company_name companyName,
       si.store_name storeName,
@@ -57,7 +59,10 @@
       c.customer_out_TDS customerOutTDS,
       c.customer_is_solve customerIsSolve,
       c.customer_is_visit customerIsVisit,
-      c.customer_create_time customerCreateTime
+      c.customer_create_time customerCreateTime,
+      v.visit_status visitStatus,
+      v.visit_complete_date visitCompleteDate,
+      cd.detect_state detectState
     from
       tb_rst_customer_info c
     LEFT JOIN tb_rst_question_describe d ON c.customer_id = d.customer_id
@@ -68,24 +73,29 @@
     LEFT JOIN tb_rst_sales_company sc ON c.company_id = sc.company_id
     LEFT JOIN tb_rst_store_info si ON c.store_id = si.store_id
     LEFT JOIN tb_rst_sys_admin a ON c.admin_id = a.admin_id
+    LEFT JOIN tb_rst_visit v ON v.customer_id = c.customer_id
+    LEFT JOIN tb_rst_complaint_detect cd ON cd.customer_id = c.customer_id
     <where>
       <if test="customerName != null and customerName != ''">
-        customer_name = #{customerName}
+        c.customer_name like CONCAT('%',#{customerName},'%')
       </if>
       <if test="customerTel != null and customerTel != ''">
-        and customer_tel = #{customerTel}
+        and c.customer_tel like CONCAT('%',#{customerTel},'%')
       </if>
-      <if test="customerName != null and customerName != ''">
-        customer_name = #{customerName}
+      <if test="describeTitle != null and describeTitle != ''">
+        and d.describe_title like CONCAT('%',#{describeTitle},'%')
       </if>
-      <if test="customerName != null and customerName != ''">
-        customer_name = #{customerName}
+      <if test="customerSourceType != null and customerSourceType != ''">
+        and c.customer_source_type = #{customerSourceType}
       </if>
-      <if test="customerName != null and customerName != ''">
-        customer_name = #{customerName}
+      <if test="complaintId != null and complaintId != ''">
+        and ct.complaint_id = #{complaintId}
       </if>
-      <if test="customerName != null and customerName != ''">
-        customer_name = #{customerName}
+      <if test="customerIsVisit != null and customerIsVisit != ''">
+        and c.customer_is_visit = #{customerIsVisit}
+      </if>
+      <if test="adminId != null and adminId != ''">
+        and c.admin_id = #{adminId}
       </if>
     </where>
   </select>
@@ -106,187 +116,60 @@
       #{customerCreateTime,jdbcType=TIMESTAMP}, #{customerUpdateTime,jdbcType=TIMESTAMP}
       )
   </insert>
-  <insert id="insertSelective" parameterType="CustomerInfo" >
-    insert into tb_rst_customer_info
-    <trim prefix="(" suffix=")" suffixOverrides="," >
-      <if test="customerId != null" >
-        customer_id,
-      </if>
-      <if test="adminId != null" >
-        admin_id,
-      </if>
-      <if test="questionId != null" >
-        question_id,
-      </if>
-      <if test="companyId != null" >
-        company_id,
-      </if>
-      <if test="storeId != null" >
-        store_id,
-      </if>
-      <if test="customerSourceType != null" >
-        customer_source_type,
-      </if>
-      <if test="customerSource != null" >
-        customer_source,
-      </if>
-      <if test="customerCounselType != null" >
-        customer_counsel_type,
-      </if>
-      <if test="customerName != null" >
-        customer_name,
-      </if>
-      <if test="customerTel != null" >
-        customer_tel,
-      </if>
-      <if test="customerIsSolve != null" >
-        customer_is_solve,
-      </if>
-      <if test="customerIsVisit != null" >
-        customer_is_visit,
-      </if>
-      <if test="customerInTds != null" >
-        customer_in_TDS,
-      </if>
-      <if test="customerOutTds != null" >
-        customer_out_TDS,
-      </if>
-      <if test="customerArea != null" >
-        customer_area,
-      </if>
-      <if test="customerCreateTime != null" >
-        customer_create_time,
-      </if>
-      <if test="customerUpdateTime != null" >
-        customer_update_time,
-      </if>
-    </trim>
-    <trim prefix="values (" suffix=")" suffixOverrides="," >
-      <if test="customerId != null" >
-        #{customerId,jdbcType=INTEGER},
-      </if>
-      <if test="adminId != null" >
-        #{adminId,jdbcType=INTEGER},
-      </if>
-      <if test="questionId != null" >
-        #{questionId,jdbcType=INTEGER},
-      </if>
-      <if test="companyId != null" >
-        #{companyId,jdbcType=INTEGER},
-      </if>
-      <if test="storeId != null" >
-        #{storeId,jdbcType=INTEGER},
-      </if>
-      <if test="customerSourceType != null" >
-        #{customerSourceType,jdbcType=TINYINT},
-      </if>
-      <if test="customerSource != null" >
-        #{customerSource,jdbcType=VARCHAR},
-      </if>
-      <if test="customerCounselType != null" >
-        #{customerCounselType,jdbcType=BIT},
-      </if>
-      <if test="customerName != null" >
-        #{customerName,jdbcType=VARCHAR},
-      </if>
-      <if test="customerTel != null" >
-        #{customerTel,jdbcType=VARCHAR},
-      </if>
-      <if test="customerIsSolve != null" >
-        #{customerIsSolve,jdbcType=TINYINT},
-      </if>
-      <if test="customerIsVisit != null" >
-        #{customerIsVisit,jdbcType=VARCHAR},
-      </if>
-      <if test="customerInTds != null" >
-        #{customerInTds,jdbcType=INTEGER},
-      </if>
-      <if test="customerOutTds != null" >
-        #{customerOutTds,jdbcType=INTEGER},
-      </if>
-      <if test="customerArea != null" >
-        #{customerArea,jdbcType=VARCHAR},
-      </if>
-      <if test="customerCreateTime != null" >
-        #{customerCreateTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="customerUpdateTime != null" >
-        #{customerUpdateTime,jdbcType=TIMESTAMP},
-      </if>
-    </trim>
-  </insert>
-  <update id="updateByPrimaryKeySelective" parameterType="CustomerInfo" >
+
+  <!-- 修改客诉信息 -->
+  <update id="updateCustomerInfo" parameterType="CustomerInfo" >
     update tb_rst_customer_info
     <set >
       <if test="adminId != null" >
-        admin_id = #{adminId,jdbcType=INTEGER},
+        admin_id = #{adminId},
       </if>
       <if test="questionId != null" >
-        question_id = #{questionId,jdbcType=INTEGER},
+        question_id = #{questionId},
       </if>
       <if test="companyId != null" >
-        company_id = #{companyId,jdbcType=INTEGER},
+        company_id = #{companyId},
       </if>
       <if test="storeId != null" >
-        store_id = #{storeId,jdbcType=INTEGER},
+        store_id = #{storeId},
       </if>
       <if test="customerSourceType != null" >
-        customer_source_type = #{customerSourceType,jdbcType=TINYINT},
+        customer_source_type = #{customerSourceType},
       </if>
       <if test="customerSource != null" >
-        customer_source = #{customerSource,jdbcType=VARCHAR},
+        customer_source = #{customerSource},
       </if>
       <if test="customerCounselType != null" >
-        customer_counsel_type = #{customerCounselType,jdbcType=BIT},
+        customer_counsel_type = #{customerCounselType},
       </if>
       <if test="customerName != null" >
-        customer_name = #{customerName,jdbcType=VARCHAR},
+        customer_name = #{customerName},
       </if>
       <if test="customerTel != null" >
-        customer_tel = #{customerTel,jdbcType=VARCHAR},
+        customer_tel = #{customerTel},
       </if>
       <if test="customerIsSolve != null" >
-        customer_is_solve = #{customerIsSolve,jdbcType=TINYINT},
+        customer_is_solve = #{customerIsSolve},
       </if>
       <if test="customerIsVisit != null" >
-        customer_is_visit = #{customerIsVisit,jdbcType=VARCHAR},
+        customer_is_visit = #{customerIsVisit},
       </if>
-      <if test="customerInTds != null" >
-        customer_in_TDS = #{customerInTds,jdbcType=INTEGER},
+      <if test="customerInTDS != null" >
+        customer_in_TDS = #{customerInTDS},
       </if>
-      <if test="customerOutTds != null" >
-        customer_out_TDS = #{customerOutTds,jdbcType=INTEGER},
+      <if test="customerOutTDS != null" >
+        customer_out_TDS = #{customerOutTDS},
       </if>
       <if test="customerArea != null" >
-        customer_area = #{customerArea,jdbcType=VARCHAR},
+        customer_area = #{customerArea},
       </if>
       <if test="customerCreateTime != null" >
-        customer_create_time = #{customerCreateTime,jdbcType=TIMESTAMP},
+        customer_create_time = #{customerCreateTime},
       </if>
       <if test="customerUpdateTime != null" >
-        customer_update_time = #{customerUpdateTime,jdbcType=TIMESTAMP},
+        customer_update_time = #{customerUpdateTime},
       </if>
     </set>
-    where customer_id = #{customerId,jdbcType=INTEGER}
-  </update>
-  <update id="updateByPrimaryKey" parameterType="CustomerInfo" >
-    update tb_rst_customer_info
-    set admin_id = #{adminId,jdbcType=INTEGER},
-      question_id = #{questionId,jdbcType=INTEGER},
-      company_id = #{companyId,jdbcType=INTEGER},
-      store_id = #{storeId,jdbcType=INTEGER},
-      customer_source_type = #{customerSourceType,jdbcType=TINYINT},
-      customer_source = #{customerSource,jdbcType=VARCHAR},
-      customer_counsel_type = #{customerCounselType,jdbcType=BIT},
-      customer_name = #{customerName,jdbcType=VARCHAR},
-      customer_tel = #{customerTel,jdbcType=VARCHAR},
-      customer_is_solve = #{customerIsSolve,jdbcType=TINYINT},
-      customer_is_visit = #{customerIsVisit,jdbcType=VARCHAR},
-      customer_in_TDS = #{customerInTds,jdbcType=INTEGER},
-      customer_out_TDS = #{customerOutTds,jdbcType=INTEGER},
-      customer_area = #{customerArea,jdbcType=VARCHAR},
-      customer_create_time = #{customerCreateTime,jdbcType=TIMESTAMP},
-      customer_update_time = #{customerUpdateTime,jdbcType=TIMESTAMP}
-    where customer_id = #{customerId,jdbcType=INTEGER}
+    where customer_id = #{customerId}
   </update>
 </mapper>

+ 3 - 92
watero-rst-service/src/main/java/com/iamberry/rst/service/cm/mapper/visitMapper.xml

@@ -32,7 +32,9 @@
     delete from tb_rst_visit
     where visit_id = #{visitId,jdbcType=INTEGER}
   </delete>
-  <insert id="insert" parameterType="Visit" >
+
+  <!-- 添加客诉回访信息 -->
+  <insert id="addVisitInfo" parameterType="Visit" >
     insert into tb_rst_visit (visit_id, customer_id, admin_id, 
       visit_name, visit_tel, visit_date, 
       visit_time_select, visit_status, visit_complete_date, 
@@ -44,97 +46,6 @@
       #{visitCompleteName,jdbcType=VARCHAR}, #{visitCompleteTel,jdbcType=CHAR}, #{visitCompleteRemark,jdbcType=VARCHAR}, 
       #{visitCreateTime,jdbcType=TIMESTAMP}, #{visitUpdateTime,jdbcType=TIMESTAMP})
   </insert>
-  <insert id="insertSelective" parameterType="Visit" >
-    insert into tb_rst_visit
-    <trim prefix="(" suffix=")" suffixOverrides="," >
-      <if test="visitId != null" >
-        visit_id,
-      </if>
-      <if test="customerId != null" >
-        customer_id,
-      </if>
-      <if test="adminId != null" >
-        admin_id,
-      </if>
-      <if test="visitName != null" >
-        visit_name,
-      </if>
-      <if test="visitTel != null" >
-        visit_tel,
-      </if>
-      <if test="visitDate != null" >
-        visit_date,
-      </if>
-      <if test="visitTimeSelect != null" >
-        visit_time_select,
-      </if>
-      <if test="visitStatus != null" >
-        visit_status,
-      </if>
-      <if test="visitCompleteDate != null" >
-        visit_complete_date,
-      </if>
-      <if test="visitCompleteName != null" >
-        visit_complete_name,
-      </if>
-      <if test="visitCompleteTel != null" >
-        visit_complete_tel,
-      </if>
-      <if test="visitCompleteRemark != null" >
-        visit_complete_remark,
-      </if>
-      <if test="visitCreateTime != null" >
-        visit_create_time,
-      </if>
-      <if test="visitUpdateTime != null" >
-        visit_update_time,
-      </if>
-    </trim>
-    <trim prefix="values (" suffix=")" suffixOverrides="," >
-      <if test="visitId != null" >
-        #{visitId,jdbcType=INTEGER},
-      </if>
-      <if test="customerId != null" >
-        #{customerId,jdbcType=INTEGER},
-      </if>
-      <if test="adminId != null" >
-        #{adminId,jdbcType=INTEGER},
-      </if>
-      <if test="visitName != null" >
-        #{visitName,jdbcType=VARCHAR},
-      </if>
-      <if test="visitTel != null" >
-        #{visitTel,jdbcType=CHAR},
-      </if>
-      <if test="visitDate != null" >
-        #{visitDate,jdbcType=DATE},
-      </if>
-      <if test="visitTimeSelect != null" >
-        #{visitTimeSelect,jdbcType=BIT},
-      </if>
-      <if test="visitStatus != null" >
-        #{visitStatus,jdbcType=TINYINT},
-      </if>
-      <if test="visitCompleteDate != null" >
-        #{visitCompleteDate,jdbcType=DATE},
-      </if>
-      <if test="visitCompleteName != null" >
-        #{visitCompleteName,jdbcType=VARCHAR},
-      </if>
-      <if test="visitCompleteTel != null" >
-        #{visitCompleteTel,jdbcType=CHAR},
-      </if>
-      <if test="visitCompleteRemark != null" >
-        #{visitCompleteRemark,jdbcType=VARCHAR},
-      </if>
-      <if test="visitCreateTime != null" >
-        #{visitCreateTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="visitUpdateTime != null" >
-        #{visitUpdateTime,jdbcType=TIMESTAMP},
-      </if>
-    </trim>
-  </insert>
   <update id="updateByPrimaryKeySelective" parameterType="Visit" >
     update tb_rst_visit
     <set >

+ 66 - 0
watero-rst-web/src/main/java/com/iamberry/rst/controllers/cm/AdminCustomerController.java

@@ -9,6 +9,7 @@ import com.iamberry.rst.faces.product.ProductService;
 import com.iamberry.rst.faces.sys.SysService;
 import com.iamberry.rst.utils.StitchAttrUtil;
 import com.iamberry.wechat.tools.ResponseJson;
+import org.apache.commons.lang.StringUtils;
 import org.apache.shiro.authz.annotation.RequiresPermissions;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
@@ -18,6 +19,7 @@ import org.springframework.web.bind.annotation.ResponseBody;
 import org.springframework.web.servlet.ModelAndView;
 
 import javax.servlet.http.HttpServletRequest;
+import java.util.Date;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -43,6 +45,11 @@ public class AdminCustomerController {
     private SysService sysService;
     @Autowired
     private ComplaintTypeInfoService complaintTypeInfoService;
+    @Autowired
+    private VisitService visitService;
+
+    public AdminCustomerController() {
+    }
 
     /**
      * 获取客诉列表
@@ -191,5 +198,64 @@ public class AdminCustomerController {
         StitchAttrUtil.setModelAndView(customerInfo, mv, "/admin/customer/select_customer_list", pagedResult);
         return mv;
     }
+
+    /**
+     * 添加回访信息
+     * @param request
+     * @param visit
+     * @return
+     */
+    @ResponseBody
+    @RequiresPermissions("customer:add:visit")
+    @RequestMapping("/add_visit_info")
+    public ResponseJson addVisitInfo(HttpServletRequest request,Visit visit) {
+        String visitAdminId = request.getParameter("visitAdminId");
+        if (!StringUtils.isNotEmpty(visitAdminId)) {
+            return new ResponseJson(500, "请选择回访人!", 500);
+        }
+        visit.setAdminId(Integer.parseInt(visitAdminId));
+        visit.setVisitStatus(1);
+        visit.setVisitCreateTime(new Date());
+        int num = visitService.addVisitInfo(visit);
+        if (num > 0) {
+            return new ResponseJson(200, "修改成功!", 200);
+        } else {
+            return new ResponseJson(500, "修改失败!", 500);
+        }
+    }
+
+    /**
+     * 修改客诉状态为已解决
+     * @param request
+     * @return
+     */
+    @ResponseBody
+    @RequiresPermissions("customer:update:customerIsSolve")
+    @RequestMapping("/update_customerIsSolve")
+    public ResponseJson updateCustomerIsSolve(HttpServletRequest request) {
+        String customerId = request.getParameter("customerId");
+        if (!StringUtils.isNotEmpty(customerId)) {
+            return new ResponseJson(500, "该客诉信息不存在!", 500);
+        }
+
+        //根据id获取客诉信息
+        CustomerInfo customer = customerService.getCustomerInfo(Integer.parseInt(customerId));
+        if (customer == null) {
+            return new ResponseJson(500, "该客诉信息不存在!", 500);
+        }
+        if (customer.getCustomerIsSolve().intValue() != 2) {
+            return new ResponseJson(500, "该客诉信息不能修改为已解决状态!", 500);
+        }
+        CustomerInfo customerInfo = new CustomerInfo();
+        customerInfo.setCustomerId(Integer.parseInt(customerId));
+        customerInfo.setCustomerIsSolve(1);
+        //修改客诉信息
+        int num = customerService.updateCustomerInfo(customerInfo);
+        if (num > 0) {
+            return new ResponseJson(200, "修改成功!", 200);
+        } else {
+            return new ResponseJson(500, "修改失败!", 500);
+        }
+    }
 }
 

+ 348 - 24
watero-rst-web/src/main/webapp/WEB-INF/views/cm/customer/custome_list.ftl

@@ -18,8 +18,8 @@
         .my-btn-search{border: 1px solid #32a3d8;padding: 1px 25px;height: 32px;background-color: #32a3d8;color: #fff;}
         .barcodeImg{margin:10px 0px}
         .table-bg thead th{background-color: #e2f6ff;}
-        input[type=radio]{-webkit-appearance:none;appearance:none;background: url(/common/images/pts/radio-1.png) center center no-repeat;background-size:auto 100%;width: 20px;height: 20px;margin-right: 10px;}
-        input[type=radio]:checked{-webkit-appearance:none;appearance:none;background: url(/common/images/pts/radio-2.png) center center no-repeat;background-size:auto 100%;width: 20px;height: 20px;margin-right: 10px;}
+        /*input[type=radio]{-webkit-appearance:none;appearance:none;background: url(/rst/common/images/pts/radio-1.png) center center no-repeat;background-size:auto 100%;width: 20px;height: 20px;margin-right: 10px;}
+        input[type=radio]:checked{-webkit-appearance:none;appearance:none;background: url(/rst/common/images/pts/radio-2.png) center center no-repeat;background-size:auto 100%;width: 20px;height: 20px;margin-right: 10px;}*/
     </style>
 </head>
 <body>
@@ -30,11 +30,141 @@
 </nav>
 <div class="page-container">
     <div class="text-c">
+        <!-- 客诉回访start -->
+        <div class="layui-layer layui-anim layui-layer-iframe" id="layui-visit" times="4" showtime="0" contype="string" style="display:none;z-index: 19891018; width: 550px; height: 400px; position: absolute; top: 100px; left: 350px;text-align: left;">
+            <form action="" name="form-admin-visit" method="post" class="form form-horizontal" id="form-admin-visit">
+                <div class="layui-layer-title" id="synOrder" style="cursor: move;" move="ok">客诉回访</div>
+                <br>
+                <div style="margin-left: 10px;">
+                    <div class="formControls">
+                        <label><span class="c-red">*</span>&nbsp;回访人信息:</label>
+                        <input type="hidden" id="customerId" name="customerId">
+                        <input type="text" id="visitName" style="width: 150px;" class="input-text" value="" placeholder="回访人姓名" name="visitName" nullmsg="回访人姓名不能为空">
+                        <input type="text" id="visitTel" style="width: 150px;" class="input-text" value="" placeholder="回访人电话" name="visitTel" nullmsg="回访人电话不能为空">
+                    </div>
+                </div>
+                <div style="margin-left: 10px;">
+                    <div class="formControls" style="margin-top: 10px;">
+                        <label><span class="c-red">*</span>&nbsp;回访日期:</label>
+                        <input type="text" id="visitDate" onClick="WdatePicker({ dateFmt:'yyyy-MM-dd',skin:'whyGreen' })" class="input-text" value="" style="width: 200px;" name="visitDate" nullmsg="回访日期不能为空" readonly="readonly"">
+                    </div>
+                    <div class="col-4"> </div>
+                </div>
+                <div style="margin-left: 10px;">
+                    <div class="formControls" style="margin-top: 10px;">
+                        <label><span class="c-red">*</span>&nbsp;回访时间:</label>
+                        <input type="radio" name="visitTimeSelect" value="1" checked="checked"/><label>9:00 - 12:00&nbsp;&nbsp;</label>
+                        <input type="radio" name="visitTimeSelect" value="2"/><label>12:00 - 14:00&nbsp;&nbsp;</label>
+                        <input type="radio" name="visitTimeSelect" value="3"/><label>14:00 - 18:00</label>
+                    </div>
+                    <div class="col-4"> </div>
+                </div>
+                <div style="margin-left: 10px;">
+                    <div class="formControls" style="margin-top: 10px;">
+                        <label><span class="c-red">*</span>&nbsp;提醒人:</label>
+                        <select class="my-select" name="visitAdminId" id="visitAdminId" style="height: 36px;width: 200px;margin: 0px;padding: 6px 10px 6px 15px;">
+                        <#if adminList?? &&  (adminList?size > 0) >
+                            <#list adminList as admin>
+                                <option value ="${admin.adminId!}" >${admin.adminName!}</option>
+                            </#list>
+                        </#if>
+                        </select>
+                    </div>
+                    <div class="col-4"> </div>
+                </div>
+                <div style="margin-left: 10px;">
+                    <label>
+                        您将为 自己 指定一个回访任务。<br/>
+                        提示原则:<br/>
+                        1、上午的回访 系统将在16日晚上22点、17日早晨9:30提醒您;<br/>
+                        2、中午的回访 系统将在本日12点提醒您;<br/>
+                        3、下午的回访 系统将在本日14:00提醒您。<br/>
+                        如果没有在指定时间完成,系统将于第二天开始推送。<br/>
+                    </label>
+                </div>
+                <div class="col-9 col-offset-3">
+                    <input class="btn btn-primary radius" onclick="addVisitInfo();" type="button" value="&nbsp;&nbsp;确认&nbsp;&nbsp;">
+                </div>
+            </form>
+            <span class="layui-layer-setwin">
+				<a class="layui-layer-ico layui-layer-close layui-layer-close1" onclick="hideVisit()" href="javascript:;"></a>
+		</span>
+        </div>
+        <!-- 客诉回访end -->
+        <!-- 录入已完成回访内容start -->
+        <div class="layui-layer layui-anim layui-layer-iframe" id="layui-visit" times="4" showtime="0" contype="string" style="display:none;z-index: 19891018; width: 550px; height: 400px; position: absolute; top: 100px; left: 350px;text-align: left;">
+            <form action="" name="form-admin-visit" method="post" class="form form-horizontal" id="form-admin-visit">
+                <div class="layui-layer-title" id="synOrder" style="cursor: move;" move="ok">已完成回访</div>
+                <br>
+                <div style="margin-left: 10px;">
+                    <div class="formControls" style="margin-top: 10px;">
+                        <label><span class="c-red">*</span>&nbsp;回访日期:</label>
+                        <input type="text" id="visitDate" onClick="WdatePicker({ dateFmt:'yyyy-MM-dd',skin:'whyGreen' })" class="input-text" value="" style="width: 200px;" name="visitDate" nullmsg="回访日期不能为空" readonly="readonly"">
+                    </div>
+                    <div class="col-4"> </div>
+                </div>
+                <div style="margin-left: 10px;">
+                    <div class="formControls" style="margin-top: 10px;">
+                        <label><span class="c-red">*</span>&nbsp;客诉性别:</label>
+                        <input type="radio" name="visitTimeSelect" value="1" checked="checked"/><label>男&nbsp;&nbsp;</label>
+                        <input type="radio" name="visitTimeSelect" value="2"/><label>女&nbsp;&nbsp;</label>
+                    </div>
+                    <div class="col-4"> </div>
+                </div>
+                <div style="margin-left: 10px;">
+                    <div class="formControls">
+                        <label><span class="c-red">*</span>&nbsp;回访人信息:</label>
+                        <input type="hidden" id="customerId" name="customerId">
+                        <input type="text" id="visitName" style="width: 150px;" class="input-text" value="" placeholder="回访人姓名" name="visitName" nullmsg="回访人姓名不能为空">
+                        <input type="text" id="visitTel" style="width: 150px;" class="input-text" value="" placeholder="回访人电话" name="visitTel" nullmsg="回访人电话不能为空">
+                    </div>
+                </div>
+                <div style="margin-left: 10px;">
+                    <div class="formControls" style="margin-top: 10px;">
+                        <label><span class="c-red">*</span>&nbsp;回访时间:</label>
+                        <input type="radio" name="visitTimeSelect" value="1" checked="checked"/><label>9:00 - 12:00&nbsp;&nbsp;</label>
+                        <input type="radio" name="visitTimeSelect" value="2"/><label>12:00 - 14:00&nbsp;&nbsp;</label>
+                        <input type="radio" name="visitTimeSelect" value="3"/><label>14:00 - 18:00</label>
+                    </div>
+                    <div class="col-4"> </div>
+                </div>
+                <div style="margin-left: 10px;">
+                    <div class="formControls" style="margin-top: 10px;">
+                        <label><span class="c-red">*</span>&nbsp;提醒人:</label>
+                        <select class="my-select" name="visitAdminId" id="visitAdminId" style="height: 36px;width: 200px;margin: 0px;padding: 6px 10px 6px 15px;">
+                        <#if adminList?? &&  (adminList?size > 0) >
+                            <#list adminList as admin>
+                                <option value ="${admin.adminId!}" >${admin.adminName!}</option>
+                            </#list>
+                        </#if>
+                        </select>
+                    </div>
+                    <div class="col-4"> </div>
+                </div>
+                <div style="margin-left: 10px;">
+                    <label>
+                        您将为 自己 指定一个回访任务。<br/>
+                        提示原则:<br/>
+                        1、上午的回访 系统将在16日晚上22点、17日早晨9:30提醒您;<br/>
+                        2、中午的回访 系统将在本日12点提醒您;<br/>
+                        3、下午的回访 系统将在本日14:00提醒您。<br/>
+                        如果没有在指定时间完成,系统将于第二天开始推送。<br/>
+                    </label>
+                </div>
+                <div class="col-9 col-offset-3">
+                    <input class="btn btn-primary radius" onclick="addVisitInfo();" type="button" value="&nbsp;&nbsp;确认&nbsp;&nbsp;">
+                </div>
+            </form>
+            <span class="layui-layer-setwin">
+				<a class="layui-layer-ico layui-layer-close layui-layer-close1" onclick="hideVisit()" href="javascript:;"></a>
+		</span>
+        </div>
+        <!-- 录入已完成回访内容end -->
         <form action="${path}/admin/customer/select_customer_list" method="post">
             <button type="button" style="cursor:pointer; float: left;" class="my-btn-search" onclick="toAddCustomer();">新建客诉</button>
-            <input type="text" class="my-input"  style="width:100px;margin-right: 0px;" value="${customerId!}" placeholder="客户问题" id="customerId" name="customerId">
-            <input type="text" class="my-input"  style="width:100px;margin-right: 0px;" value="${customerId!}" placeholder="客户电话号码" id="customerId" name="customerId">
-            <input type="text" class="my-input"  style="width:100px;margin-right: 0px;" value="${customerId!}" placeholder="请输入问题描述" id="customerId" name="customerId">
+            <input type="text" class="my-input"  style="width:100px;margin-right: 0px;" value="${customerId!}" placeholder="客户姓名" id="customerName" name="customerName">
+            <input type="text" class="my-input"  style="width:100px;margin-right: 0px;" value="${customerId!}" placeholder="客户电话号码" id="customerTel" name="customerTel">
+            <input type="text" class="my-input"  style="width:100px;margin-right: 0px;" value="${customerId!}" placeholder="请输入问题描述" id="describeTitle" name="describeTitle">
             <select class="my-select" name="customerSource" id="customerSource" style="height: 36px;width: 100px;margin: 0px;padding: 6px 10px 6px 15px;">
                 <option value="">来源</option>
                 <option value="1" <#if customerInfo.customerSourceType??><#if customerInfo.customerSourceType == "1" >selected="selected"</#if></#if>>400电话</option>
@@ -49,18 +179,13 @@
                     </#list>
                 </#if>
             </select>
-            <select class="my-select" name="produceId" style="height: 36px;width: 100px;margin: 0px;padding: 6px 10px 6px 15px;">
+            <select class="my-select" name="complaintId" style="height: 36px;width: 100px;margin: 0px;padding: 6px 10px 6px 15px;">
                 <option value ="">客诉类型</option>
                 <#if complaintTypeList?? &&  (complaintTypeList?size > 0) >
                     <#list complaintTypeList as complaint>
-                        <option value ="${complaint.complaintId!}" <#if customerInfo.adminId??><#if customerInfo.adminId ==admin.adminId >selected="selected"</#if></#if>>${complaint.complaintClassName!}</option>
+                        <option value ="${complaint.complaintId!}" <#if customerInfo.complaintId??><#if customerInfo.complaintId ==complaint.complaintId >selected="selected"</#if></#if>>${complaint.complaintClassName!}</option>
                     </#list>
                 </#if>
-            <#--<#if typeList?? &&  (typeList?size > 0) >
-                <#list typeList as type>
-                    <option value ="${type.produceId!}" <#if produceId??><#if produceId ==produce.produceId >selected="selected"</#if></#if>>${produce.produceName!}</option>
-                </#list>
-            </#if>-->
             </select>
             <select class="my-select" name="customerIsVisit" style="height: 36px;width: 100px;margin: 0px;padding: 6px 10px 6px 15px;">
                 <option value ="">是否需要回访</option>
@@ -125,37 +250,136 @@
                             <td>${(customer.salesTime?string("yyyy-MM-dd HH:mm:ss"))!''}</td>
                             <td>${customer.customerArea!''}</td>
                             <td>进${customer.customerInTDS!'0'}出${customer.customerOutTDS!'0'}</td>
-                            <td>
+                            <td id="txt_customerIsSolve">
                                 <#if customer.customerIsSolve == 1>
                                     已解决
                                 <#elseif customer.customerIsSolve == 2>
                                     未解决
                                 <#elseif customer.customerIsSolve == 3>
-                                    换新
+                                    换新(
+                                    <#if customer.backStatus == 1>
+                                        未寄回
+                                    <#elseif customer.backStatus == 2>
+                                        已寄回
+                                    <#elseif customer.backStatus == 3>
+                                        已收货
+                                    </#if>,
+                                    <#if customer.sendStatus == 1>
+                                        未寄送
+                                    <#elseif customer.sendStatus == 2>
+                                        已寄送
+                                    <#elseif customer.sendStatus == 3>
+                                        已收货
+                                    </#if>,
+                                    <#if customer.detectState == 1>
+                                        待仓库转入
+                                    <#elseif customer.detectState == 2>
+                                        正在检查
+                                    <#elseif customer.detectState == 3>
+                                        检查通过
+                                    <#elseif customer.detectState == 4>
+                                        检查未通过
+                                    </#if>
+                                    )
                                 <#elseif customer.customerIsSolve == 4>
-                                    维修
+                                    维修(
+                                    <#if customer.backStatus == 1>
+                                        未寄回
+                                    <#elseif customer.backStatus == 2>
+                                        已寄回
+                                    <#elseif customer.backStatus == 3>
+                                        已收货
+                                    </#if>,
+                                    <#if customer.sendStatus == 1>
+                                        未寄送
+                                    <#elseif customer.sendStatus == 2>
+                                        已寄送
+                                    <#elseif customer.sendStatus == 3>
+                                        已收货
+                                    </#if>,
+                                    <#if customer.detectState == 1>
+                                        待仓库转入
+                                    <#elseif customer.detectState == 2>
+                                        正在检查
+                                    <#elseif customer.detectState == 3>
+                                        检查通过
+                                    <#elseif customer.detectState == 4>
+                                        检查未通过
+                                    </#if>
+                                    )
                                 <#elseif customer.customerIsSolve == 5>
-                                    补发
+                                    补发(
+                                    <#if customer.backStatus == 1>
+                                        未寄回
+                                    <#elseif customer.backStatus == 2>
+                                        已寄回
+                                    <#elseif customer.backStatus == 3>
+                                        已收货
+                                    </#if>,
+                                    <#if customer.sendStatus == 1>
+                                        未寄送
+                                    <#elseif customer.sendStatus == 2>
+                                        已寄送
+                                    <#elseif customer.sendStatus == 3>
+                                        已收货
+                                    </#if>,
+                                    <#if customer.detectState == 1>
+                                        待仓库转入
+                                    <#elseif customer.detectState == 2>
+                                        正在检查
+                                    <#elseif customer.detectState == 3>
+                                        检查通过
+                                    <#elseif customer.detectState == 4>
+                                        检查未通过
+                                    </#if>
+                                    )
                                 <#elseif customer.customerIsSolve == 6>
                                     退货
                                 <#elseif customer.customerIsSolve == 7>
                                     无理由退货
                                 </#if>
                             </td>
-                            <td>${customer.customerIsVisit!''}</td>
+                            <td>
+                                <#if customer.customerIsVisit == "1">
+                                    不需要回访
+                                <#elseif customer.customerIsVisit == "2">
+                                    需要回访
+                                </#if>
+                            </td>
                             <td>${(customer.customerCreateTime?string("yyyy-MM-dd HH:mm:ss"))!''}</td>
                             <td>
-                                <a style="text-decoration:none" href="javascript:void(0);" title="编辑" onclick="admin_update_customer(${customer.customerId!''})">
-                                    <i class="Hui-iconfont">&#xe6df;</i>
+                                <#if customer.customerIsSolve == 2>
+                                    <a style="text-decoration:none" href="javascript:void(0);" title="已解决" onclick="updateCustomerIsSolve(${customer.customerId!''})">
+                                        <i class="Hui-iconfont">已解决</i>
+                                    </a>&nbsp;
+                                </#if>
+                                <a style="text-decoration:none" href="javascript:void(0);" title="详情" onclick="admin_update_customer(${customer.customerId!''})">
+                                    <i class="Hui-iconfont">详情</i>
+                                </a>&nbsp;
+                                <#if customer.customerIsVisit == "2">
+                                    <a style="text-decoration:none" href="javascript:void(0);" title="详情" onclick="admin_update_customer(${customer.customerId!''})">
+                                        <i class="Hui-iconfont">
+                                            <#if customer.visitStatus == 1 && customer.customerIsVisit == "2">
+                                                已完成回访
+                                            <#elseif customer.visitStatus == 2>
+                                                已收到反馈
+                                            </#if>
+                                        </i>
+                                    </a>&nbsp;
+                                </#if>
+                                <a style="text-decoration:none" href="javascript:void(0);" title="修改客诉信息" onclick="admin_update_customer(${customer.customerId!''})">
+                                    <i class="Hui-iconfont">修改客诉信息</i>
                                 </a>&nbsp;
-                                <a style="text-decoration:none" href="javascript:void(0);" title="查看customer单详情" onclick="admin_details_customer(${customer.customerId!''})">
-                                    <i class="Hui-iconfont">&#xe665;</i>
-                                </a>
+                                <#if customer.customerIsVisit == "1">
+                                    <a style="text-decoration:none" href="javascript:void(0)" title="需要回访" onclick="showVisit(${customer.customerId!''})">
+                                        <i class="Hui-iconfont">需要回访</i>
+                                    </a>
+                                </#if>
                             </td>
                         </tr>
                     </#list>
             <#else>
-                <tr><td colspan="10" class="td-manage text-c" >暂时没有Customer,请添加!</td></tr>
+                <tr><td colspan="10" class="td-manage text-c" >暂时没有客诉信息,请添加!</td></tr>
             </#if>
         </tbody>
     </table>
@@ -164,7 +388,12 @@
 <tfoot>
 <#include "/base/page_util.ftl">
 </tfoot>
-<script>
+<script type="text/javascript">
+
+    var mobile=/^(13|14|15|18)[0-9]{9}$/; //手机号码
+    var uname = /^[\u4e00-\u9fa5a-zA-Z]{1,12}$/; //中文英文
+    var flag = true;
+
     /**
      * 跳转到添加customer页面
      */
@@ -188,6 +417,101 @@
         window.location.href= "${path}/admin/customer/to_details_customer?customerId="+customerId;
     }
 
+    function showVisit(customerId) {
+        $('#layui-visit').show();
+        $('#customerId').val(customerId);
+    }
+
+    function hideVisit() {
+        $('#layui-visit').hide();
+    }
+
+    function checkValue() {
+
+        var visitTimeSelect = $('input[name="visitTimeSelect"]:checked').val();
+        var visitAdminId = $("#visitAdminId option:selected").val();
+        if (!uname.test($('#visitName').val().trim())) {
+            alert("回访人姓名格式不正确,请重新填写!");
+            flag = false;
+            return;
+        }
+        if (!mobile.test($('#visitTel').val().trim())) {
+            alert("手机号码格式不正确,请重新填写!");
+            flag = false;
+            return;
+        }
+        if ($('#visitDate').val().trim() == null || $('#visitDate').val().trim() == '') {
+            alert("请选择回访日期!");
+            flag = false;
+            return;
+        }
+        if (visitTimeSelect == null || visitTimeSelect == '') {
+            alert("请选择回访时间点!");
+            flag = false;
+            return;
+        }
+        if (visitAdminId == null || visitAdminId == '') {
+            alert("请选择提醒人!");
+            flag = false;
+            return;
+        }
+    }
+
+    /**
+     * 添加回访信息
+     */
+    function addVisitInfo() {
+        checkValue();
+        alert(flag);
+        if (flag) {
+            $.ajax({
+                cache: true,
+                type: "POST",
+                data: $('#form-admin-visit').serialize(),
+                url: "${path}/admin/customer/add_visit_info",
+                async: false,
+                success: function(data){
+                    if (data.returnCode == 200) {
+                        layer.msg(data.resultMsg,{icon: 1,time:1000});
+                        $('#layui-visit').hide();
+                    } else {
+                        layer.msg(data.resultMsg,{icon: 5,time:1000});
+                        $('#layui-visit').hide();
+                    }
+                },
+                error: function(XmlHttpRequest, textStatus, errorThrown){
+                }
+            });
+        }
+    }
+
+    /**
+     * 将未解决状态修改为已解决
+     */
+    function updateCustomerIsSolve(customerId) {
+        layer.confirm('确认要修改吗?',function(index){
+            $.ajax({
+                cache: true,
+                type: "POST",
+                data: {"customerId":customerId},
+                url: "${path}/admin/customer/update_customerIsSolve",
+                async: false,
+                success: function(data){
+                    if (data.returnCode == 200) {
+                        layer.msg(data.resultMsg,{icon: 1,time:1000});
+                        $('#txt_customerIsSolve').html('已解决');
+                    } else {
+                        layer.msg(data.resultMsg,{icon: 5,time:1000});
+                    }
+                },
+                error: function(XmlHttpRequest, textStatus, errorThrown){
+                }
+            })
+        }, function() {
+
+        });
+    }
+
 </script>
 </body>
 </html>