ソースを参照

合并客诉代码

liuzhiwei 7 年 前
コミット
e9a251ca8d
21 ファイル変更495 行追加118 行削除
  1. 25 0
      watero-rst-core/src/main/java/com.iamberry.rst.core/cm/ComplaintDetectInfo.java
  2. 17 0
      watero-rst-interface/src/main/java/com/iamberry/rst/faces/cm/CompanyInfoService.java
  3. 7 0
      watero-rst-interface/src/main/java/com/iamberry/rst/faces/cm/SalesOrderService.java
  4. 6 0
      watero-rst-interface/src/main/java/com/iamberry/rst/faces/product/ProductService.java
  5. 24 0
      watero-rst-service/src/main/java/com/iamberry/rst/service/cm/CompanyInfoServiceImpl.java
  6. 5 0
      watero-rst-service/src/main/java/com/iamberry/rst/service/cm/SalesOrderServiceImpl.java
  7. 7 0
      watero-rst-service/src/main/java/com/iamberry/rst/service/cm/mapper/CompanyInfoMapper.java
  8. 6 6
      watero-rst-service/src/main/java/com/iamberry/rst/service/cm/mapper/SalesOrderMapper.java
  9. 9 0
      watero-rst-service/src/main/java/com/iamberry/rst/service/cm/mapper/companyInfoMapper.xml
  10. 14 18
      watero-rst-service/src/main/java/com/iamberry/rst/service/cm/mapper/complaintDetectInfoMapper.xml
  11. 31 9
      watero-rst-service/src/main/java/com/iamberry/rst/service/cm/mapper/salesOrderMapper.xml
  12. 4 1
      watero-rst-service/src/main/java/com/iamberry/rst/service/cm/mapper/storeInfoMapper.xml
  13. 5 0
      watero-rst-service/src/main/java/com/iamberry/rst/service/product/ProductServiceImpl.java
  14. 5 0
      watero-rst-service/src/main/java/com/iamberry/rst/service/product/mapper/ProductMapper.java
  15. 3 1
      watero-rst-service/src/main/java/com/iamberry/rst/service/product/mapper/productMapper.xml
  16. 63 2
      watero-rst-web/src/main/java/com/iamberry/rst/controllers/cm/AdminCustomerController.java
  17. 50 2
      watero-rst-web/src/main/java/com/iamberry/rst/controllers/cm/AdminDetectController.java
  18. 1 1
      watero-rst-web/src/main/java/com/iamberry/rst/controllers/pts/PtsCodeController.java
  19. 129 45
      watero-rst-web/src/main/webapp/WEB-INF/views/cm/customer/order_list.ftl
  20. 75 24
      watero-rst-web/src/main/webapp/WEB-INF/views/cm/inspection/add_detect.ftl
  21. 9 9
      watero-rst-web/src/main/webapp/WEB-INF/views/cm/inspection/detect_list.ftl

+ 25 - 0
watero-rst-core/src/main/java/com.iamberry.rst.core/cm/ComplaintDetectInfo.java

@@ -1,5 +1,8 @@
 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;
 
@@ -31,8 +34,14 @@ public class ComplaintDetectInfo implements Serializable {
     private Date signclosedUpdateTime;//修改时间
     private String machineNo;//机器编号
 
+    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(pattern="yyyy-MM-dd",timezone = "GMT+8")
+    private Date detectDate;//检测时间
+
+
     private String questionTitle;//问题标题
     private String detectIsMaintenance;//是否需要维修
+    private String productName;//是否需要维修
 
 
     public Integer getDetectId() {
@@ -202,4 +211,20 @@ public class ComplaintDetectInfo implements Serializable {
     public void setDetectIsMaintenance(String detectIsMaintenance) {
         this.detectIsMaintenance = detectIsMaintenance;
     }
+
+    public Date getDetectDate() {
+        return detectDate;
+    }
+
+    public void setDetectDate(Date detectDate) {
+        this.detectDate = detectDate;
+    }
+
+    public String getProductName() {
+        return productName;
+    }
+
+    public void setProductName(String productName) {
+        this.productName = productName;
+    }
 }

+ 17 - 0
watero-rst-interface/src/main/java/com/iamberry/rst/faces/cm/CompanyInfoService.java

@@ -0,0 +1,17 @@
+package com.iamberry.rst.faces.cm;
+
+import com.iamberry.rst.core.cm.CompanyInfo;
+
+import java.util.List;
+
+/**
+ * 销售公司
+ */
+public interface CompanyInfoService {
+
+    /**
+     * 查询销售公司集合
+     */
+    List<CompanyInfo> listCompanyInfo(CompanyInfo companyInfo);
+
+}

+ 7 - 0
watero-rst-interface/src/main/java/com/iamberry/rst/faces/cm/SalesOrderService.java

@@ -44,4 +44,11 @@ public interface SalesOrderService {
      * @return
      */
     boolean addOrderAndItem(SalesOrder salesOrder, List<SalesOrderItem> list);
+
+    /**
+     * 获取订单集合
+     * @param salesOrder
+     * @return
+     */
+    List<SalesOrder> listSalesOrder (SalesOrder salesOrder);
 }

+ 6 - 0
watero-rst-interface/src/main/java/com/iamberry/rst/faces/product/ProductService.java

@@ -52,4 +52,10 @@ public interface ProductService {
      * @return
      */
     List<ProductColor> listproductAndColor(ProductColor productColor);
+
+    /**
+     * 获取单个水机  奶机
+     * @return
+     */
+    Product getProduce(String productId);
 }

+ 24 - 0
watero-rst-service/src/main/java/com/iamberry/rst/service/cm/CompanyInfoServiceImpl.java

@@ -0,0 +1,24 @@
+package com.iamberry.rst.service.cm;
+
+import com.iamberry.rst.core.cm.CompanyInfo;
+import com.iamberry.rst.faces.cm.CompanyInfoService;
+import com.iamberry.rst.service.cm.mapper.CompanyInfoMapper;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * 销售公司
+ */
+@Service
+public class CompanyInfoServiceImpl implements CompanyInfoService{
+
+    @Autowired
+    private CompanyInfoMapper companyInfoMapper;
+
+    @Override
+    public List<CompanyInfo> listCompanyInfo(CompanyInfo companyInfo) {
+        return companyInfoMapper.listCompanyInfo(companyInfo);
+    }
+}

+ 5 - 0
watero-rst-service/src/main/java/com/iamberry/rst/service/cm/SalesOrderServiceImpl.java

@@ -39,6 +39,11 @@ public class SalesOrderServiceImpl implements SalesOrderService {
     }
 
     @Override
+    public List<SalesOrder> listSalesOrder(SalesOrder salesOrder) {
+        return salesOrderMapper.listSalesOrder(salesOrder);
+    }
+
+    @Override
     public boolean addOrderAndItem(SalesOrder salesOrder, List<SalesOrderItem> list) {
         if (list == null || list.size() == 0) {
             return false;

+ 7 - 0
watero-rst-service/src/main/java/com/iamberry/rst/service/cm/mapper/CompanyInfoMapper.java

@@ -2,6 +2,8 @@ package com.iamberry.rst.service.cm.mapper;
 
 import com.iamberry.rst.core.cm.CompanyInfo;
 
+import java.util.List;
+
 public interface CompanyInfoMapper {
 
     /**
@@ -24,4 +26,9 @@ public interface CompanyInfoMapper {
      * @return
      */
     Integer updateCompanyInfo(CompanyInfo companyInfo);
+
+    /**
+     * 查询销售公司集合
+     */
+    List<CompanyInfo> listCompanyInfo(CompanyInfo companyInfo);
 }

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

@@ -36,16 +36,16 @@ public interface SalesOrderMapper {
     Integer addSalesOrderList(List<SalesOrder> list);
 
     /**
-     * 批量添加订单项
-     * @param list
+     * 获取订单集合
+     * @param salesOrder
      * @return
      */
-    Integer addOrderItemList(List<SalesOrderItem> list);
+    List<SalesOrder> listSalesOrder (SalesOrder salesOrder);
 
     /**
-     *  查询订单列表
-     * @param salesOrder
+     * 批量添加订单项
+     * @param list
      * @return
      */
-    List<SalesOrder> listSalesOrder(SalesOrder salesOrder);
+    Integer addOrderItemList(List<SalesOrderItem> list);
 }

+ 9 - 0
watero-rst-service/src/main/java/com/iamberry/rst/service/cm/mapper/companyInfoMapper.xml

@@ -23,6 +23,15 @@
     where company_id = #{companyId,jdbcType=INTEGER}
   </select>
 
+  <select id="listCompanyInfo" resultType="CompanyInfo" parameterType="CompanyInfo" >
+    select
+    <include refid="companyInfo" />
+    from tb_rst_sales_company
+    where
+      company_status = 1
+  </select>
+
+
   <!-- 添加销售公司信息 -->
   <insert id="addCompanyInfo" parameterType="CompanyInfo" useGeneratedKeys="true" keyProperty="companyId">
     insert into tb_rst_sales_company (company_id, company_name, company_abbreviation, 

+ 14 - 18
watero-rst-service/src/main/java/com/iamberry/rst/service/cm/mapper/complaintDetectInfoMapper.xml

@@ -6,7 +6,6 @@
     <result column="customer_id" property="customerId" jdbcType="INTEGER" />
     <result column="signclosed_id" property="signclosedId" jdbcType="INTEGER" />
     <result column="product_id" property="productId" jdbcType="INTEGER" />
-    <result column="detect_product_type" property="detectProductType" jdbcType="BIT" />
     <result column="detect_product_number" property="detectProductNumber" jdbcType="VARCHAR" />
     <result column="detect_state" property="detectState" jdbcType="BIT" />
     <result column="detect_phenomenon" property="detectPhenomenon" jdbcType="VARCHAR" />
@@ -22,12 +21,14 @@
     <result column="signclosed_update_time" property="signclosedUpdateTime" jdbcType="TIMESTAMP" />
     <result column="machine_no" property="machineNo" jdbcType="VARCHAR" />
     <result column="detect_is_maintenance" property="detectIsMaintenance" jdbcType="VARCHAR" />
+    <result column="detect_date" property="detectDate" jdbcType="DATE" />
+
   </resultMap>
   <sql id="Base_Column_List" >
-    detect_id, customer_id,signclosed_id,product_id, detect_product_type, detect_product_number, detect_state,
+    detect_id, customer_id,signclosed_id,product_id,detect_product_number, detect_state,
     detect_phenomenon, detect_failure_classification, detect_failure_cause, detect_results, 
     detect_point, detect_analysis, detect_customer_id, detect_revolution_produced, detect_desc, 
-    signclosed_create_time, signclosed_update_time,detect_is_maintenance
+    signclosed_create_time, signclosed_update_time,detect_is_maintenance,detect_date
   </sql>
   <select id="getComplaintDetectById" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
     select 
@@ -42,7 +43,6 @@
       cd.signclosed_id signclosedId,
       cd.product_id productId,
       cd.customer_id customerId,
-      cd.detect_product_type detectProductType,
       cd.detect_product_number detectProductNumber,
       cd.detect_state detectState,
       cd.detect_phenomenon detectPhenomenon,
@@ -57,12 +57,13 @@
       cd.signclosed_create_time signclosedCreateTime,
       cd.signclosed_update_time signclosedUpdateTime,
       cd.machine_no machineNo,
-      cd.detect_is_maintenance
+      cd.detect_is_maintenance detectIsMaintenance,
+      cd.detect_date detectDate,
+      ci.customer_question_title questionTitle,
+      pi.product_name productName
     from tb_rst_complaint_detect cd LEFT JOIN tb_rst_customer_info ci ON cd.customer_id = ci.customer_id
+        LEFT JOIN tb_rst_product_info pi ON cd.product_id = pi.product_id
     <where>
-      <if test="detectProductType != null and detectProductType != ''">
-        cd.detect_product_type = #{detectProductType,jdbcType=BIT}
-      </if>
       <if test="detectProductNumber != null and detectProductNumber != ''" >
        AND cd.detect_product_number = #{detectProductNumber,jdbcType=VARCHAR}
       </if>
@@ -102,20 +103,21 @@
     </where>
   </select>
   <insert id="insert" parameterType="ComplaintDetectInfo" >
-    insert into tb_rst_complaint_detect (detect_id, customer_id,signclosed_id,product_id, detect_product_type,
+    insert into tb_rst_complaint_detect (detect_id, customer_id,signclosed_id,product_id,
       detect_product_number, detect_state, detect_phenomenon, 
       detect_failure_classification, detect_failure_cause, 
       detect_results, detect_point, detect_analysis, 
       detect_customer_id, detect_revolution_produced, 
-      detect_desc, signclosed_create_time, signclosed_update_time,machine_no,detect_is_maintenance
+      detect_desc, signclosed_create_time, signclosed_update_time,machine_no,detect_is_maintenance,detect_date
       )
-    values (#{detectId,jdbcType=INTEGER}, #{customerId,jdbcType=INTEGER}, #{detectProductType,jdbcType=BIT}, 
+    values (#{detectId,jdbcType=INTEGER}, #{customerId,jdbcType=INTEGER},#{signclosedId,jdbcType=INTEGER},
+      #{productId,jdbcType=INTEGER},
       #{detectProductNumber,jdbcType=VARCHAR}, #{detectState,jdbcType=BIT}, #{detectPhenomenon,jdbcType=VARCHAR}, 
       #{detectFailureClassification,jdbcType=VARCHAR}, #{detectFailureCause,jdbcType=VARCHAR}, 
       #{detectResults,jdbcType=VARCHAR}, #{detectPoint,jdbcType=VARCHAR}, #{detectAnalysis,jdbcType=VARCHAR}, 
       #{detectCustomerId,jdbcType=INTEGER}, #{detectRevolutionProduced,jdbcType=BIT}, 
       #{detectDesc,jdbcType=VARCHAR}, #{signclosedCreateTime,jdbcType=TIMESTAMP}, #{signclosedUpdateTime,jdbcType=TIMESTAMP}
-      ,#{machineNo,jdbcType=TIMESTAMP},#{detectIsMaintenance,jdbcType=BIT}
+      ,#{machineNo,jdbcType=VARCHAR},#{detectIsMaintenance,jdbcType=BIT},#{detectDate,jdbcType=DATE}
       )
   </insert>
 
@@ -125,9 +127,6 @@
       <if test="customerId != null" >
         customer_id = #{customerId,jdbcType=INTEGER},
       </if>
-      <if test="detectProductType != null" >
-        detect_product_type = #{detectProductType,jdbcType=BIT},
-      </if>
       <if test="detectProductNumber != null" >
         detect_product_number = #{detectProductNumber,jdbcType=VARCHAR},
       </if>
@@ -161,9 +160,6 @@
       <if test="detectDesc != null" >
         detect_desc = #{detectDesc,jdbcType=VARCHAR},
       </if>
-      <if test="signclosedCreateTime != null" >
-        signclosed_create_time = #{signclosedCreateTime,jdbcType=TIMESTAMP},
-      </if>
       <if test="signclosedUpdateTime != null" >
         signclosed_update_time = #{signclosedUpdateTime,jdbcType=TIMESTAMP},
       </if>

+ 31 - 9
watero-rst-service/src/main/java/com/iamberry/rst/service/cm/mapper/salesOrderMapper.xml

@@ -49,6 +49,37 @@
     where sales_id = #{salesId,jdbcType=INTEGER}
   </select>
 
+  <!-- 订单集合 -->
+  <select id="listSalesOrder" resultType="SalesOrder" parameterType="SalesOrder" >
+    select
+    <include refid="salesOrderInfo" />
+    from tb_rst_sales_order_info
+    <where>
+      <if test="salesStatus !=null and salesStatus !=''">
+        AND sales_status = #{salesStatus}
+      </if>
+      <if test="salesStoreId !=null and salesStoreId !=''">
+        AND sales_store_id = #{salesStoreId}
+      </if>
+      <if test="salesCompanyId !=null and salesCompanyId !=''">
+        AND sales_company_id = #{salesCompanyId}
+      </if>
+      <if test="salesId !=null">
+        AND sales_id like CONCAT('%',#{salesId},'%')
+      </if>
+      <if test="salesOrderId !=null and salesOrderId !=''">
+        AND sales_orderId like CONCAT('%',#{salesOrderId},'%')
+      </if>
+      <if test="salesAddressTel !=null and salesAddressTel !=''">
+        AND sales_address_tel like CONCAT('%',#{salesAddressTel},'%')
+      </if>
+      <if test="salesAddressName !=null and salesAddressName !=''">
+        AND sales_address_name like CONCAT('%',#{salesAddressName},'%')
+      </if>
+    </where>
+    ORDER BY sales_create_time DESC
+  </select>
+
   <!-- 添加订单信息 -->
   <insert id="addSalesOrder" parameterType="SalesOrder" keyProperty="salesId" useGeneratedKeys="true" >
     insert into tb_rst_sales_order_info (sales_id, sales_orderId, sales_openId, 
@@ -91,15 +122,6 @@
     </foreach>
   </insert>
 
-  <!-- 查询订单列表 -->
-  <select id="listSalesOrder" parameterType="SalesOrder" resultType="SalesOrder">
-    select
-      *
-    from
-      tb_rst_sales_order_info
-    ORDER BY sales_create_time DESC
-  </select>
-
   <!-- 批量添加订单信息 -->
   <insert id="addSalesOrderList" parameterType="ArrayList" >
     insert into tb_rst_sales_order_info (

+ 4 - 1
watero-rst-service/src/main/java/com/iamberry/rst/service/cm/mapper/storeInfoMapper.xml

@@ -33,7 +33,10 @@
         store_efast = #{storeEfast}
       </if>
       <if test="storeStatus != null">
-        and storeStatus = #{storeStatus}
+        and store_status = #{storeStatus}
+      </if>
+      <if test="companyId != null">
+        and company_id = #{companyId}
       </if>
     </where>
   </select>

+ 5 - 0
watero-rst-service/src/main/java/com/iamberry/rst/service/product/ProductServiceImpl.java

@@ -106,4 +106,9 @@ public class ProductServiceImpl implements ProductService {
     public List<ProductColor> listproductAndColor(ProductColor productColor) {
         return productMapper.listproductAndColor(productColor);
     }
+
+    @Override
+    public Product getProduce(String productId) {
+        return productMapper.getProduce(productId);
+    }
 }

+ 5 - 0
watero-rst-service/src/main/java/com/iamberry/rst/service/product/mapper/ProductMapper.java

@@ -34,4 +34,9 @@ public interface ProductMapper {
      * @return
      */
     List<ProductColor> listproductAndColor(ProductColor productColor);
+    /**
+     * 获取单个水机  奶机
+     * @return
+     */
+    Product getProduce(String productId);
 }

+ 3 - 1
watero-rst-service/src/main/java/com/iamberry/rst/service/product/mapper/productMapper.xml

@@ -55,5 +55,7 @@
     <select id="listProduce"  resultType="product">
         select * from tb_rst_product_info where product_type = 1
     </select>
-
+    <select id="getProduce"  resultType="product">
+        select * from tb_rst_product_info where product_id = #{productId}
+    </select>
 </mapper>

+ 63 - 2
watero-rst-web/src/main/java/com/iamberry/rst/controllers/cm/AdminCustomerController.java

@@ -1,13 +1,20 @@
 package com.iamberry.rst.controllers.cm;
 
-import com.iamberry.rst.core.cm.CustomerInfo;
+import com.iamberry.rst.core.cm.*;
+import com.iamberry.rst.faces.cm.CompanyInfoService;
+import com.iamberry.rst.faces.cm.SalesOrderService;
+import com.iamberry.rst.faces.cm.StoreInfoService;
+import com.iamberry.wechat.tools.ResponseJson;
 import org.apache.shiro.authz.annotation.RequiresPermissions;
+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.RequestParam;
+import org.springframework.web.bind.annotation.ResponseBody;
 import org.springframework.web.servlet.ModelAndView;
 
 import javax.servlet.http.HttpServletRequest;
+import java.util.List;
 
 /**
  * Created by wxm
@@ -16,7 +23,14 @@ import javax.servlet.http.HttpServletRequest;
 @RequestMapping("/admin/customer")
 public class AdminCustomerController {
 
+    @Autowired
+    private CompanyInfoService companyInfoService;
 
+    @Autowired
+    private StoreInfoService storeInfoService;
+
+    @Autowired
+    private SalesOrderService salesOrderService;
 
     /**
      * 获取客诉列表
@@ -61,7 +75,7 @@ public class AdminCustomerController {
     }
 
     /**
-     * 客诉搜索订单列表
+     * 搜索订单列表弹出框
      *
      * @return
      */
@@ -70,11 +84,58 @@ public class AdminCustomerController {
     public ModelAndView selectOrder(HttpServletRequest request) {
         ModelAndView mv = new ModelAndView("cm/customer/order_list");
 
+        //获取销售公司
+        List<CompanyInfo> companyInfoList =  companyInfoService.listCompanyInfo(new CompanyInfo());
 
+        mv.addObject("companyInfoList", companyInfoList);
         return mv;
     }
 
 
+    /**
+     * 获取店铺集合
+     * @param request
+     * @param storeInfo
+     * @return
+     */
+    @ResponseBody
+    @RequiresPermissions("customer:add:customer")
+    @RequestMapping(value = "/select_storeInfo")
+    public ResponseJson listStoreInfo(HttpServletRequest request,StoreInfo storeInfo) {
+        storeInfo.setStoreStatus(1);
+        List<StoreInfo> storeInfoList = storeInfoService.listStore(storeInfo);
+
+        if (storeInfoList == null || storeInfoList.size() < 1) {
+            return new ResponseJson(500, "查询失败", 500);
+        } else {
+            ResponseJson rj =new ResponseJson(200, "查询成功", 200);
+            rj.addResponseKeyValue("storeInfoList", storeInfoList);
+            return rj;
+        }
+    }
+
+    /**
+     * 获取订单集合
+     * @param request
+     * @param salesOrder
+     * @return
+     */
+    @ResponseBody
+    @RequiresPermissions("customer:add:customer")
+    @RequestMapping(value = "/select_salesOrder")
+    public ResponseJson listOrder(HttpServletRequest request,SalesOrder salesOrder) {
+        List<SalesOrder> salesOrderList = salesOrderService.listSalesOrder(salesOrder);
+
+
+
+        if (salesOrderList == null || salesOrderList.size() < 1) {
+            return new ResponseJson(500, "查询失败", 500);
+        } else {
+            ResponseJson rj =new ResponseJson(200, "查询成功", 200);
+            rj.addResponseKeyValue("salesOrderList", salesOrderList);
+            return rj;
+        }
+    }
 
 }
 

+ 50 - 2
watero-rst-web/src/main/java/com/iamberry/rst/controllers/cm/AdminDetectController.java

@@ -7,19 +7,24 @@ import com.iamberry.rst.core.order.Product;
 import com.iamberry.rst.core.order.RentType;
 import com.iamberry.rst.core.page.PageRequest;
 import com.iamberry.rst.core.page.PagedResult;
+import com.iamberry.rst.core.pts.PtsDevice;
 import com.iamberry.rst.faces.cm.ComplaintDetectInfoService;
 import com.iamberry.rst.faces.cm.FittingsInfoService;
 import com.iamberry.rst.faces.product.ProductService;
 import com.iamberry.rst.utils.AdminUtils;
+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;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.ResponseBody;
 import org.springframework.web.servlet.ModelAndView;
 
 import javax.servlet.http.HttpServletRequest;
+import java.text.SimpleDateFormat;
+import java.util.Date;
 import java.util.List;
 
 /**
@@ -50,9 +55,9 @@ public class AdminDetectController {
         //获取所有产品
         List<Product> productList = productService.listProduce();
         mv.addObject("productList",productList);
-        //获取所有配件
+        /*//获取所有配件
         List<FittingsInfo> listFittings = fittingsInfoService.listFittings();
-        mv.addObject("listFittings",listFittings);
+        mv.addObject("listFittings",listFittings);*/
         return mv;
     }
 
@@ -122,5 +127,48 @@ public class AdminDetectController {
         return mv;
     }
 
+    /**
+     * 添加检测信息
+     * @param request
+     * @return
+     * @throws Exception
+     */
+    @RequiresPermissions("detect:add:detect")
+    @ResponseBody
+    @RequestMapping("/add_detect")
+    public ResponseJson addDetect(HttpServletRequest request, ComplaintDetectInfo detectInfo) throws Exception {
+        ResponseJson msg = new ResponseJson();
+        if(detectInfo == null){
+            msg.setResultCode(500);
+            msg.setReturnCode(500);
+            return msg;
+        }
+        if(detectInfo.getProductId() == null || detectInfo.getProductId().equals("")){
+            msg.setResultCode(500);
+            msg.setReturnCode(500);
+            return msg;
+        }
+        Product  product =  productService.getProduce(String.valueOf(detectInfo.getProductId()));
+        detectInfo.setDetectProductNumber(product.getProductNumber());
+
+
+        String detectDate = request.getParameter("detect_date");
+        if(detectDate == null){
+            msg.setResultCode(500);
+            msg.setReturnCode(500);
+            return msg;
+        }
+        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
+        detectInfo.setDetectDate(format.parse(detectDate));
+        Integer num = complaintDetectInfoService.insert(detectInfo);
+        if (num < 1) {
+            msg.setResultCode(500);
+            msg.setReturnCode(500);
+        } else {
+            msg.setResultCode(200);
+            msg.setReturnCode(200);
+        }
+        return msg;
+    }
 }
 

+ 1 - 1
watero-rst-web/src/main/java/com/iamberry/rst/controllers/pts/PtsCodeController.java

@@ -87,7 +87,7 @@ public class PtsCodeController {
             if(phones.get(i).length() != 11){
                 return "快递公司出错,请检查文档内的数据是否正常!";
             }
-            String text = MessageFormat.format(SEND_NOTICE_INFORM, autograph);
+            String text = MessageFormat.format(SEND_NOTICE_INFORM2, autograph);
             msg = smsService.sendOtherCMS(phones.get(i),text);
             if(msg.equals("SUCCESS")){
                 successNumber++;

+ 129 - 45
watero-rst-web/src/main/webapp/WEB-INF/views/cm/customer/order_list.ftl

@@ -23,62 +23,73 @@
     </style>
 </head>
 <body>
-<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页
-    <span class="c-gray en">&gt;</span> 客诉管理
-    <span class="c-gray en">&gt;</span> 客诉列表
-    <a class="btn radius r" style="line-height:1.6em;margin-top:3px;background: #32a3d8;color: #fff;border:1px solid #32a3d8;" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a>
-</nav>
 <div class="page-container">
     <div class="text-c">
         <form action="${path}/admin/customer/_customer_list" method="post">
             <div class="row cl">
                 <div class="formControls col-4 col-sm-4" style="width: 150px;"> <span class="select-box">
-                    <select name="" class="select">
-                        <option value="0">薇薇</option>
-                        <option value="1">薇薇</option>
-                        <option value="11">薇薇</option>
-                        <option value="12">薇薇</option>
-                        <option value="13">薇薇</option>
+                    <select name="" class="select" id="companyId">
+                        <#if companyInfoList?? &&  (companyInfoList?size > 0) >
+                            <#list companyInfoList as companyInfo>
+                                <option value ="${companyInfo.companyId!""}">${companyInfo.companyName!""}</option>
+                            </#list>
+                        </#if>
                     </select>
                     </span>
                 </div>
                 <div class="formControls col-4 col-sm-4" style="width: 150px;"> <span class="select-box">
-                    <select name="" class="select">
-                        <option value="0">薇薇</option>
-                        <option value="1">薇薇</option>
-                        <option value="11">薇薇</option>
-                        <option value="12">薇薇</option>
-                        <option value="13">薇薇</option>
+                    <select name="" class="select" id="storeId">
                     </select>
                     </span>
                 </div>
+                <div class="formControls col-4 col-sm-4" style="width: 150px;"> <span class="select-box">
+                    <select name="" class="select" id="storeId">
+                        <option value="1">取消订单</option>
+                        <option value="2">待支付</option>
+                        <#--<option value="3"></option>
+                        <option value="4"></option>
+                        <option value="5"></option>
+                        <option value="6"></option>
+                        <option value="7"></option>
+                        <option value="8"></option>
+                        <option value="9"></option>
+                        <option value="10"></option>
+                        <option value="11"></option>
+                        <option value="12"></option>-->
+                    </select>
+                    </span>
+                </div>
+                <div class="formControls col-2 col-sm-2">
+                    <input type="text" class="input-text" value="" placeholder="订单编号" id="salesId" name="">
+                </div>
+                <div class="formControls col-2 col-sm-2">
+                    <input type="text" class="input-text" value="" placeholder="收货人姓名" id="salesAddressName" name="">
+                </div>
                 <div class="formControls col-2 col-sm-2">
-                    <input type="text" class="input-text" value="" placeholder="请输入手机号" id="" name="">
+                    <input type="text" class="input-text" value="" placeholder="收货人电话" id="salesAddressTel" name="">
                 </div>
-                <button type="submit" class="btn" style="background: #32a3d8;color: #fff;-webkit-transform:translateY(-5%);" id="" name=""><i class="Hui-iconfont">&#xe665;</i> 搜索</button>
+                <button type="submit" class="btn" style="background: #32a3d8;color: #fff;-webkit-transform:translateY(-5%);" id="searchOrder" name=""><i class="Hui-iconfont">&#xe665;</i> 搜索</button>
             </div>
         </form>
     </div>
 
-    <#--<div class="mt-20">
+    <div class="mt-20">
         <table class="table table-border table-bordered table-bg table-hover table-sort">
         <thead>
         <tr class="text-c">
-            &lt;#&ndash;<th width="50">Customer编号</th>&ndash;&gt;
-            <th width="60">所属产品</th>
-            <th width="100">customer名称</th>
-            <th width="80">硬件版本</th>
-            <th width="80">零件总数量</th>
-            <th width="80">零件总成本(元)</th>
-            <th width="80">零件总重(g)</th>
-            <th width="100">备注</th>
-            <th width="80">最近修改时间</th>
-            <th width="80">添加时间</th>
+            <th width="50">渠道商</th>
+            <th width="60">订单编号</th>
+            <th width="100">收货人姓名</th>
+            <th width="80">收货人电话</th>
+            <th width="80">订单金额</th>
+            <th width="80">购买产品</th>
+            <th width="80">购买日期</th>
+            <th width="100">收货地址</th>
             <th width="80">操作</th>
         </tr>
         </thead>
-        <tbody>
-            <#if page.dataList?? &&  (page.dataList?size > 0) >
+        <tbody id="orderAll">
+            <#--<#if page.dataList?? &&  (page.dataList?size > 0) >
                     <#list page.dataList as customer>
                         <tr class="text-c">
                             &lt;#&ndash;<td>${customer.customerId!''}</td>&ndash;&gt;
@@ -91,32 +102,105 @@
                             <td>${customer.customerRemarks!''}</td>
                             <td>${(customer.customerUpdateTime?string("yyyy-MM-dd HH:mm:ss"))!''}</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>
-                                </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>
-                            </td>
                         </tr>
                     </#list>
             <#else>
                 <tr><td colspan="10" class="td-manage text-c" >暂时没有Customer,请添加!</td></tr>
-            </#if>
+            </#if>-->
         </tbody>
     </table>
-    </div>-->
+    </div>
 </div>
 <tfoot>
 <#--<#include "/base/page_util.ftl">-->
 </tfoot>
 <script>
+
+    $(function () {
+        /*选择店铺*/
+        selectStoreInfo();
+
+        /*搜索*/
+        $(document).on('click', '#searchOrder', function() {
+            searchOrder();
+        });
+    })
+
+    /*获取销售公司下的所有店铺*/
+    function selectStoreInfo() {
+        var companyId = $("#companyId").val();
+        var html = "";
+        $.ajax({
+            type: "POST",
+            data: {
+                companyId : companyId
+            },
+            url: "${path}/admin/customer/select_storeInfo",
+            async: false,
+            success: function(data){
+                var id;
+                if (data.returnCode == 200) {
+                    for(var i=0;i<data.returnMsg.storeInfoList.length;i++){
+                        var storeInfo = data.returnMsg.storeInfoList[i];
+                        html += '<option value="'+ storeInfo.storeId +'">'+ storeInfo.storeName +'</option>';
+                    }
+                }else{
+                    html = '';
+                }
+                $("#storeId").html(html);
+            },
+            error: function(XmlHttpRequest, textStatus, errorThrown){
+            }
+        });
+    }
+
     /**
-     * 跳转到添加customer页面
+     * 搜索订单
      */
-    function toAddCustomer(){
-        window.location.href= "${path}/admin/customer/to_add_customer";
+    function searchOrder(){
+        var salesCompanyId = $("#companyId").val();
+        var salesStoreId = $("#storeId").val();
+        var salesStatus = $("#salesStatus").val();
+        var salesId = $("#salesId").val();
+        var salesAddressName = $("#salesAddressName").val();
+        var salesAddressTel = $("#salesAddressTel").val();
+        var html = "";
+        $.ajax({
+            type: "POST",
+            data: {
+                salesCompanyId : salesCompanyId,
+                salesStoreId : salesStoreId,
+                salesStatus : salesStatus,
+                salesId : salesId,
+                salesAddressName : salesAddressName,
+                salesAddressTel : salesAddressTel
+            },
+            url: "${path}/admin/customer/select_salesOrder",
+            async: false,
+            success: function(data){
+                if (data.returnCode == 200) {
+                    for(var i=0;i<data.returnMsg.salesOrderList.length;i++){
+                        var salesOrder = data.returnMsg.salesOrderList[i];
+                        html += '<tr class="text-c">' +
+                                ' <td></td>' +
+                                ' <td></td>' +
+                                ' <td></td>' +
+                                ' <td></td>' +
+                                ' <td></td>' +
+                                ' <td></td>' +
+                                ' <td></td>' +
+                                ' <td></td>' +
+                                ' <td></td>' +
+                                ' </tr>';
+                    }
+                }else{
+                    html = '';
+                }
+                $("#orderAll").html(html);
+            },
+            error: function(XmlHttpRequest, textStatus, errorThrown){
+            }
+        });
     }
 
     /**

+ 75 - 24
watero-rst-web/src/main/webapp/WEB-INF/views/cm/inspection/add_detect.ftl

@@ -30,14 +30,10 @@
 <body>
 <article class="page-container">
     <form class="form form-horizontal" id="form-admin-add">
-
-
         <div class="input-box">
             <span class="input-dic" style="margin-top: 0">检测产品&nbsp;&nbsp;</span>
             <label for="radio-1">
-                <input type="radio" id="radio-1" name="detectProductType" value="1" checked/>产品
-                <select name="orderPayType" style="width:100px">
-
+                <select name="productId" style="width:100px" class="select">
                 <#if (productList ?size > 0)>
                     <#list productList as list>
                         <option value ="${list.productId}">${list.productName}</option>
@@ -46,16 +42,16 @@
                     <option value ="">暂无产品,请先添加产品</option>
                 </#if>
                 </select>
-                <input class="my-input" type="text" id="machineNo" name="machineNo" style="width: 30%;" placeholder="机器编号" />
+                <input class="input-text" type="text" id="machineNo" name="machineNo" style="width: 50%;" placeholder="机器编号" />
             </label>
         </div>
 
-        <div class="input-box">
+        <#--<div class="input-box">
             <span class="input-dic" style="margin-top: 0">&nbsp;</span>
 
             <label for="radio-2" style="margin-left: 50px;">
                 <input type="radio" id="radio-2" name="detectProductType" value="2"/>配件
-                <select name="orderPayType"  style="width:100px">
+                <select name="productId2" class="select" style="width:100px">
                 <#if (listFittings ?size > 0)>
                     <#list listFittings as list>
                         <option value ="${list.fittingsId}">${list.fittingsName}</option>
@@ -65,9 +61,9 @@
                 </#if>
                 </select>
             </label>
-        </div>
+        </div>-->
 
-        <div class="input-box"><span class="input-dic spanhidth">检测日期</span><input class="my-input-date" type="text" style="width: 76%;"  name="signclosedUpdateTime" id="signclosedUpdateTime" onClick="WdatePicker({skin:'whyGreen',maxDate:'%y-%M-%d'})" placeholder="请选择检测日期" readonly="readonly"/> </div>
+        <div class="input-box"><span class="input-dic spanhidth">检测日期</span><input class="my-input-date" type="text" style="width: 76%;"  name="detect_date" id="detectDate" onClick="WdatePicker({skin:'whyGreen',maxDate:'%y-%M-%d'})" placeholder="请选择检测日期" readonly="readonly"/> </div>
 
         <div class="input-box">
             <span class="input-dic" style="margin-top: 0">检测结果</span>
@@ -128,39 +124,94 @@
             <textarea rows="3" cols="20" name="detectDesc" id="detectDesc" class="my-textarea" placeholder="请详细备注签收的内容,便于以后复查。如果转入生产,则生产部门同事可查看!"></textarea>
         </div>
         <div>
-           <button type="button" class="my-btn-submit" onclick="">确认提交</button>
+           <button type="button" class="my-btn-submit" onclick="add();">确认提交</button>
         </div>
     </form>
 </article>
 <script type="text/javascript" src="${path}/common/lib/My97DatePicker/4.8/WdatePicker.js"></script>
 <script type="text/javascript">
-    $(function(){
 
 
-    });
-
     function  add() {
+        var detectDate = $("#detectDate").val();
+        if( detectDate == null || detectDate == "" ){
+            layer.msg('请选择检测日期',{icon: 5,time:1000});
+            return;
+        }
+        var detectPhenomenon = $("#detectPhenomenon").val();
+        if( detectPhenomenon == null || detectPhenomenon == "" ){
+            layer.msg('请输入工厂检测现象',{icon: 5,time:1000});
+            return;
+        }
+        if( detectPhenomenon.length > 300 ){
+            layer.msg('工厂检测现象长度不得大于150个字符',{icon: 5,time:1000});
+            return;
+        }
+        var detectFailureClassification = $("#detectFailureClassification").val();
+        if( detectFailureClassification == null || detectFailureClassification == "" ){
+            layer.msg('请输入故障分类',{icon: 5,time:1000});
+            return;
+        }
+        if( detectFailureClassification.length > 50 ){
+            layer.msg('故障分类长度不得大于25个字符',{icon: 5,time:1000});
+            return;
+        }
+        var detectFailureCause = $("#detectFailureCause").val();
+        if( detectFailureCause == null || detectFailureCause == "" ){
+            layer.msg('请输入故障原因',{icon: 5,time:1000});
+            return;
+        }
+        if( detectFailureCause.length > 100 ){
+            layer.msg('故障原因长度不得大于50个字符',{icon: 5,time:1000});
+            return;
+        }
+
+        var detectResults = $("#detectResults").val();
+        if( detectResults == null || detectResults == "" ){
+            layer.msg('请输入判定结果',{icon: 5,time:1000});
+            return;
+        }
+        if( detectResults.length > 100 ){
+            layer.msg('判定结果长度不得大于50个字符',{icon: 5,time:1000});
+            return;
+        }
+
+        var detectPoint = $("#detectPoint").val();
+        if( detectPoint == null || detectPoint == "" ){
+            layer.msg('请输入故障指向',{icon: 5,time:1000});
+            return;
+        }
+        if( detectPoint.length > 100 ){
+            layer.msg('故障指向长度不得大于50个字符',{icon: 5,time:1000});
+            return;
+        }
+
+        var detectAnalysis = $("#detectAnalysis").val();
+        if( detectAnalysis == null || detectAnalysis == "" ){
+            layer.msg('请输入原因分析',{icon: 5,time:1000});
+            return;
+        }
+        if( detectAnalysis.length > 100 ){
+            layer.msg('原因分析长度不得大于50个字符',{icon: 5,time:1000});
+            return;
+        }
         $.ajax({
             cache: true,
             type: "POST",
-            url: "${path}/admin/order/save_order_money",
+            url: "${path}/admin/detect/add_detect",
             data:$('#form-admin-add').serialize(),// 你的formid
             async: false,
             success: function(data){
                 if (data.returnCode == 200) {
-                    window.parent.admin_result("支付成功!",1);
+                    layer.msg('添加成功',{icon: 1,time:1000},function () {
+                        location.replace(location.href);
+                    });
                 } else {
-                    window.parent.admin_result(data.resultMsg,5);
+                    layer.msg('添加失败',{icon: 5,time:1000});
                 }
-                var index = parent.layer.getFrameIndex(window.name);
-                parent.$('.btn-refresh').click();
-                parent.layer.close(index);
             },
             error: function(XmlHttpRequest, textStatus, errorThrown){
-                window.parent.admin_result("支付失败!",5);
-                var index = parent.layer.getFrameIndex(window.name);
-                parent.$('.btn-refresh').click();
-                parent.layer.close(index);
+                layer.msg('添加错误',{icon: 5,time:1000});
             }
         });
     }

+ 9 - 9
watero-rst-web/src/main/webapp/WEB-INF/views/cm/inspection/detect_list.ftl

@@ -5,7 +5,7 @@
     <title></title>
     <style>
         *{padding: 0;margin: 0;}
-        .my-input{border: 1px solid rgba(0,0,0,.1);padding: 1px 5px;height: 32px;margin-right: 10px;}
+        .my-input{border: 1px solid rgba(0,0,0,.1);padding: 1px 5px;height: 25px;margin-right: 5px;}
         /*.my-input::-webkit-input-placeholder,.my-select{color: #dcdcdc;}*/
         .my-select{border: 1px solid rgba(0,0,0,.1);padding:6px 50px 6px 15px;height: 34px;margin: 0 10px; -webkit-appearance:none;appearance:none;background: url(/common/images/pts/select-1.png) right center no-repeat;background-size:auto 100%;}
         .my-btn-search{border: 1px solid #32a3d8;padding: 1px 25px;height: 32px;background-color: #32a3d8;color: #fff;}
@@ -26,12 +26,12 @@
     <div class="text-c">
         <form name="form1" action="${path}/admin/detect/select_detect_list" method="post">
             <button type="button" style="cursor:pointer;float: left;" class="my-btn-search" onclick="add_detect('添加品质检测','${path}/admin/detect/to_add_detect','570','450');">新建品检</button>
-            <input class="my-input" type="text" name="questionTitle" value="${questionTitle!}" placeholder="客诉问题"/>
-            <input class="my-input" type="text" name="detectPhenomenon" value="${detectPhenomenon!}" placeholder="工厂检测现象"/>
-            <input class="my-input" type="text" name="detectFailureCause" value="${detectFailureCause!}" placeholder="故障原因"/>
-            <input class="my-input" type="text" name="detectPoint" value="${detectPoint!}" placeholder="故障指向"/>
-            <input class="my-input" type="text" name="detectAnalysis" value="${detectAnalysis!}" placeholder="原因分析"/>
-            <input class="my-input" type="text" name="detectFailureClassification" value="${detectFailureClassification!}" placeholder="故障分类"/>
+            <input class="my-input" style="width: 70px;" type="text" name="questionTitle" value="${questionTitle!}" placeholder="客诉问题"/>
+            <input class="my-input" style="width: 70px;" type="text" name="detectPhenomenon" value="${detectPhenomenon!}" placeholder="工厂检测现象"/>
+            <input class="my-input" style="width: 70px;" type="text" name="detectFailureCause" value="${detectFailureCause!}" placeholder="故障原因"/>
+            <input class="my-input" style="width: 70px;" type="text" name="detectPoint" value="${detectPoint!}" placeholder="故障指向"/>
+            <input class="my-input" style="width: 70px;" type="text" name="detectAnalysis" value="${detectAnalysis!}" placeholder="原因分析"/>
+            <input class="my-input" style="width: 70px;" type="text" name="detectFailureClassification" value="${detectFailureClassification!}" placeholder="故障分类"/>
 
             <select class="my-select" name="detectState" style="height: 30px;width: 150px">
                 <option value ="">选择状态</option>
@@ -72,7 +72,7 @@
             <#if (page.dataList?size > 0)>
                 <#list page.dataList as detect>
                 <tr>
-                    <td class="text-c" width="100">${detect.detectProductType!}</td>
+                    <td class="text-c" width="100">${detect.productName!}</td>
                     <td class="text-c" width="100">${detect.detectProductNumber!}</td>
                     <td class="text-c" width="100">
                         <#if detect.detectState == 1>
@@ -107,7 +107,7 @@
                         </#if>
                     </td>
                     <td class="text-c" width="100">${detect.detectDesc!}</td>
-                    <td class="text-c" width="100">${(detect.signclosedCreateTime?string("yyyy-MM-dd"))!''}</td>
+                    <td class="text-c" width="100">${(detect.detectDate?string("yyyy-MM-dd"))!''}</td>
                     <!-- 遍历操作 -->
                     <td class="td-manage text-c">
                         <#--<a style="text-decoration:none" href="javascript:;" title="修改"