Kaynağa Gözat

Merge branch 'master' of http://git.iamberry.com/hexiugang/iamberry-common-parent

liuzhiwei 7 yıl önce
ebeveyn
işleme
18275e2f0a
31 değiştirilmiş dosya ile 827 ekleme ve 272 silme
  1. 0 11
      .project
  2. 4 1
      iamberry-wechat-service/src/main/java/com/iamberry/wechat/service/mapper/productInfoMapper.xml
  3. 11 3
      iamberry-wechat-web/src/main/java/com/iamberry/wechat/filters/WechatFilter.java
  4. 1 1
      iamberry-wechat-web/src/main/java/com/iamberry/wechat/handles/cart/ProductInfoHandler.java
  5. 1 5
      iamberry-wechat-web/src/main/java/com/iamberry/wechat/handles/pay/RequestWechatPayHandler.java
  6. 0 17
      iamberry-wechat-web/src/main/webapp/WEB-INF/views/wechat/.project
  7. 52 5
      iamberry-wechat-web/src/main/webapp/common/wechat/my-center.html
  8. 191 103
      iamberry-wechat-web/src/main/webapp/common/wechat/pro-details.html
  9. 5 1
      watero-common-tool/src/main/java/com/iamberry/wechat/tools/ResultInfo.java
  10. 10 0
      watero-rst-core/src/main/java/com.iamberry.rst.core/cm/CustomerCommon.java
  11. 4 1
      watero-rst-core/src/main/java/com.iamberry.rst.core/cm/QuestionDescribe.java
  12. 44 0
      watero-rst-interface/src/main/java/com/iamberry/rst/faces/cm/CustomerCommonService.java
  13. 7 0
      watero-rst-interface/src/main/java/com/iamberry/rst/faces/cm/QuestionDescribeService.java
  14. 80 0
      watero-rst-service/src/main/java/com/iamberry/rst/service/cm/CustomerCommonServiceImpl.java
  15. 5 0
      watero-rst-service/src/main/java/com/iamberry/rst/service/cm/QuestionDescribeServiceImpl.java
  16. 13 4
      watero-rst-service/src/main/java/com/iamberry/rst/service/cm/mapper/complaintQuestionInfoMapper.xml
  17. 22 3
      watero-rst-service/src/main/java/com/iamberry/rst/service/cm/mapper/customerInfoMapper.xml
  18. 6 1
      watero-rst-service/src/main/java/com/iamberry/rst/service/cm/mapper/questionDescribeMapper.xml
  19. 12 12
      watero-rst-service/src/main/java/com/iamberry/rst/service/cm/mapper/salesOrderMapper.xml
  20. 16 3
      watero-rst-service/src/main/java/com/iamberry/rst/service/cm/mapper/visitMapper.xml
  21. 88 8
      watero-rst-web/src/main/java/com/iamberry/rst/controllers/cm/AdminCustomerController.java
  22. 3 4
      watero-rst-web/src/main/java/com/iamberry/rst/controllers/pts/AdminMachineController.java
  23. 1 0
      watero-rst-web/src/main/resources/platform.properties
  24. 1 1
      watero-rst-web/src/main/webapp/WEB-INF/views/cm/customer/add_customer.ftl
  25. 236 77
      watero-rst-web/src/main/webapp/WEB-INF/views/cm/customer/update_customer.ftl
  26. 2 0
      watero-rst-web/src/main/webapp/WEB-INF/views/order/excel_to_order.ftl
  27. 2 2
      watero-rst-web/src/main/webapp/WEB-INF/views/pts/batch/add_batch.ftl
  28. 3 3
      watero-rst-web/src/main/webapp/WEB-INF/views/pts/batch/update_batch.ftl
  29. 1 1
      watero-rst-web/src/main/webapp/WEB-INF/views/pts/produce/produce_list.ftl
  30. 3 2
      watero-rst-web/src/main/webapp/WEB-INF/views/pts/produce/save_produce.ftl
  31. 3 3
      watero-rst-web/src/main/webapp/WEB-INF/views/pts/produce/update_produce.ftl

+ 0 - 11
.project

@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-	<name>iamberry-common-parent</name>
-	<comment></comment>
-	<projects>
-	</projects>
-	<buildSpec>
-	</buildSpec>
-	<natures>
-	</natures>
-</projectDescription>

+ 4 - 1
iamberry-wechat-service/src/main/java/com/iamberry/wechat/service/mapper/productInfoMapper.xml

@@ -95,7 +95,10 @@
 		ug.user_gift_count userGiftCount,
 		ug.user_status userStatus,
 		ug.user_create_time userCreateTime,
-		pi.product_name productName
+		pi.product_name giftName,
+		pi.product_color giftColorName,
+		pi.product_child_type giftChildType,
+		pi.Product_introduce_img giftProductPic
 		FROM
 		tb_iamberry_sales_user_gift ug
 		LEFT JOIN tb_iamberry_product_color pc on pc.color_id = #{cartColorId}

+ 11 - 3
iamberry-wechat-web/src/main/java/com/iamberry/wechat/filters/WechatFilter.java

@@ -29,9 +29,9 @@ import com.iamberry.wechat.tools.NameUtils;
  * @date	2016年11月3日
  * @explain	完成和微信自动登录的过程,如果登录,那么通过,否则自动登录,完成Oauth过程
  */
-@WebFilter(value = { "/wechat/*","/pay/goOrderInfo","/common/wechat/*" })
+@WebFilter(value = { "/wechat/*","/pay/goOrderInfo" })
 public class WechatFilter implements Filter {
-	
+
 	private static Logger logger = LoggerFactory.getLogger(WechatFilter.class);
 
 	public void doFilter(ServletRequest request, ServletResponse response,
@@ -52,7 +52,15 @@ public class WechatFilter implements Filter {
 			
 			// 请求数据URI,并去掉"/" + 项目名称
 			String query = req.getQueryString();
-			String redirectUrl = req.getRequestURI().toString().replace(req.getContextPath(), "");
+			String urlstr = req.getRequestURI().toString();
+			String redirectUrl = urlstr.replace(req.getContextPath(), "");
+
+			// 如果没有登录,并且来自于微信,请求的链接并且为/wechat/qrcode/xxxx,那么放过,保证可以保持机器信息
+			String ua = req.getHeader("user-agent").toLowerCase();
+			if( ua.indexOf("micromessenger") < 0 && urlstr.indexOf("wechat/qrcode") > 0) {
+				chain.doFilter(req, resp);
+				return;
+			}
 
 			// 到此就准备开始授权的流程,并且保证转发后再次定位到当前请求页面
 			if (query != null) redirectUrl = redirectUrl + "?" + query;

+ 1 - 1
iamberry-wechat-web/src/main/java/com/iamberry/wechat/handles/cart/ProductInfoHandler.java

@@ -417,7 +417,7 @@ public class ProductInfoHandler {
 		// 重要操作,判断是否登陆,防止服务器重启
 		if (member == null || member.getUserOpenid() == null) { // 重新授权
 			request.getSession().setAttribute(NameUtils.redirectUrl, request.getRequestURI().replace(request.getContextPath(), ""));
-			String url = WechatUtils.getOpenIdFunction();response.sendRedirect(url);return;
+			return;
 		}
 		// 校验数据
 		if (productIdMd5 == null || "".equals(productIdMd5)) {

+ 1 - 5
iamberry-wechat-web/src/main/java/com/iamberry/wechat/handles/pay/RequestWechatPayHandler.java

@@ -67,11 +67,7 @@ public class RequestWechatPayHandler {
 		Member member = wechatUtils.getUserBySession(request);
 		
 		if (member == null || member.getUserOpenid() == null) {
-			String redirectUrl = request.getRequestURI().replace(request.getContextPath(), "");
-			request.getSession().setAttribute(NameUtils.redirectUrl, redirectUrl);
-			String url = WechatUtils.getOpenIdFunction();
-			mv.setViewName("redirect:" + url);
-			return mv;
+			return null;
 		}
 		// 清空数据
 		request.getSession().removeAttribute("cartIds");

+ 0 - 17
iamberry-wechat-web/src/main/webapp/WEB-INF/views/wechat/.project

@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-	<name>wechat</name>
-	<comment></comment>
-	<projects>
-	</projects>
-	<buildSpec>
-		<buildCommand>
-			<name>com.aptana.ide.core.unifiedBuilder</name>
-			<arguments>
-			</arguments>
-		</buildCommand>
-	</buildSpec>
-	<natures>
-		<nature>com.aptana.projects.webnature</nature>
-	</natures>
-</projectDescription>

+ 52 - 5
iamberry-wechat-web/src/main/webapp/common/wechat/my-center.html

@@ -43,17 +43,18 @@
 				<img width="100%" src="images/top-1.png" />
 				<div style="position: absolute;left: 0; top: 45%;-webkit-transform: translateY(-50%);width: 100%;text-align: center;">
 					<div class="user-head">
-						<img src="images/tx-1.jpg" />
+						<img id="headDiv" src="" />
 					</div>
-					<div>微微一笑倾城</div>
+					<div id="userNickname">微微一笑倾城</div>
 				</div>
 			</div>
 			<div style="padding:0;background: #fff;margin-bottom: 8px;">
 				<div id="menu-nav" class="mui-segmented-control">
-					<a class="mui-control-item">
-						<div class="iconfont icon-quanbao"><span class="mui-badge">9</span></div>
+					<a class="mui-control-item" id="couponList">
+						<div class="iconfont icon-quanbao">
+							<!--<span class="mui-badge">9</span>-->
+						</div>
 						券包
-						
 					</a>
 					<a class="mui-control-item">
 						<div class="iconfont icon-zhibaoqia"></div>
@@ -169,6 +170,52 @@
 				$("#menu>li").removeClass("active");
 				$("#menu").css("height","0px");
 			});
+
+			/*优惠券*/
+            $(document).on('tap', '#couponList', function() {
+                window.location.href= "coupon_list.html";
+            });
+		</script>
+
+		<script>
+            mui.ready(function(){
+                mui.ajax( base_path + '/wechat/agent/member?dates=' + new Date().getTime(),{
+                    dataType:'json',
+                    type:'post',
+                    timeout:15000,
+                    success:function(dt){
+                        var data = dt.data;
+                        //console.log(dt)
+                        if(dt.status){
+//                        userIdentity = data.userIdentity;
+                            if(data.userHead != null  && typeof(data.userHead)!="undefined" && data.userHead != ''){
+                                //var imgObj = $("<img src='" + data.userHead + "?" + new Date().getTime() + "'/>");
+                                $("#headDiv").attr("src",data.userHead);
+                            }
+                            if(data.userNickname != null  && typeof(data.userNickname)!="undefined" && data.userNickname != ''){
+                                $("#userNickname").html(decodeURI(data.userNickname));
+                            }
+//                        $("#userNickname").append('<img class="vip_icon" src="http://static.iamberry.com/images/shop/dl_icon.png" />');
+//                        document.querySelector('.loading-bg').style.display='none';
+
+
+                        }else{
+//                        var btnArray = ['否', '是'];
+//                        mui.confirm(dt.message, '爱贝源-提示', btnArray, function(e) {
+//                            if (e.index == 1) {
+//                                location.reload(true);
+//                            }
+//                        });
+                        }
+                    },
+                    error:function(xhr,type,errorThrown){
+                        //异常处理;
+                        errorfn(xhr);
+                    }
+                });
+            })
+
+            //
 		</script>
 	</body>
 

+ 191 - 103
iamberry-wechat-web/src/main/webapp/common/wechat/pro-details.html

@@ -1,110 +1,198 @@
 <!DOCTYPE html>
 <html>
 
-	<head>
-		<meta charset="utf-8">
-		<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1, user-scalable=no">
-		<meta name="apple-mobile-web-app-capable" content="yes">
-		<meta name="apple-mobile-web-app-status-bar-style" content="black">
-		<title>产品详情</title>
-		<link rel="stylesheet" type="text/css" href="css/mui.min.css" />
-		<link rel="stylesheet" type="text/css" href="css/iconfont.css" />
-		<link rel="stylesheet" type="text/css" href="css/main.css" />
-		<script type="text/javascript" src="//res.wx.qq.com/open/js/jweixin-1.1.0.js"></script>
-		<script>
-			//屏蔽分享
-//			document.addEventListener('WeixinJSBridgeReady', function onBridgeReady() {
-//				WeixinJSBridge.call('hideOptionMenu');
-//			});
-		</script>
-	</head>
+<head>
+	<meta charset="utf-8">
+	<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1, user-scalable=no">
+	<meta name="apple-mobile-web-app-capable" content="yes">
+	<meta name="apple-mobile-web-app-status-bar-style" content="black">
+	<title>产品详情</title>
+	<link rel="stylesheet" type="text/css" href="//s.iamberry.com/wechat/aiberle/css/mui.min.css" />
+	<link rel="stylesheet" type="text/css" href="//s.iamberry.com/wechat/aiberle/css/iconfont.css" />
+	<link rel="stylesheet" type="text/css" href="//s.iamberry.com/wechat/aiberle/css/main.css" />
+	<script type="text/javascript" src="//res.wx.qq.com/open/js/jweixin-1.1.0.js"></script>
+	<script>
+        //屏蔽分享
+        //			document.addEventListener('WeixinJSBridgeReady', function onBridgeReady() {
+        //				WeixinJSBridge.call('hideOptionMenu');
+        //			});
+	</script>
+</head>
 
-	<body>
-		<footer class="mui-bar mui-bar-tab">
-			<ul class="mui-table-view mui-table-view-striped mui-table-view-condensed my-grid-view-no">
-				<li class="mui-table-view-cell">
-					<div class="mui-table"><div class="mui-table-cell mui-col-xs-4 table-middle"><span class="iconfont icon-gouwuche"></span></div><div class="mui-table-cell mui-col-xs-8 table-middle div-btn-buy-know">立即购买</div></div>
-				</li>
-			</ul>
-		</footer>
-		<div class="mui-content">
-			<div class="banner-box-pro">
-			<div id="slider" class="mui-slider">
-				<div class="mui-slider-group mui-slider-loop">
-					<!-- 额外增加的一个节点(循环轮播:第一个节点是最后一张轮播) -->
-					<div class="mui-slider-item mui-slider-item-duplicate">
-						<a href="#">
-							<img src="images/banner-3.jpg">
-						</a>
-					</div>
-					<!-- 第一张 -->
-					<div class="mui-slider-item">
-						<a href="#">
-							<img src="images/banner-1.jpg">
-						</a>
-					</div>
-					<!-- 第二张 -->
-					<div class="mui-slider-item">
-						<a href="#">
-							<img src="images/banner-2.jpg">
-						</a>
-					</div>
-					<!-- 第三张 -->
-					<div class="mui-slider-item">
-						<a href="#">
-							<img src="images/banner-3.jpg">
-						</a>
-					</div>
-					<!-- 额外增加的一个节点(循环轮播:最后一个节点是第一张轮播) -->
-					<div class="mui-slider-item mui-slider-item-duplicate">
-						<a href="#">
-							<img src="images/banner-1.jpg">
-						</a>
-					</div>
-				</div>
-				<div class="mui-slider-indicator">
-					<div class="mui-indicator mui-active"></div>
-					<div class="mui-indicator"></div>
-					<div class="mui-indicator"></div>
-				</div>
+<body>
+<footer class="mui-bar mui-bar-tab">
+	<ul class="mui-table-view mui-table-view-striped mui-table-view-condensed my-grid-view-no">
+		<li class="mui-table-view-cell">
+			<div class="mui-table"><div class="mui-table-cell mui-col-xs-4 table-middle"><span class="iconfont icon-gouwuche"></span></div><div class="mui-table-cell mui-col-xs-8 table-middle div-btn-buy-know">立即购买</div></div>
+		</li>
+	</ul>
+</footer>
+<div class="mui-content">
+		<div class="banner-box-pro" style="display: none;"></div>
+	<ul class="mui-table-view mui-grid-view my-view-no" style="padding-bottom: 0;">
+		<li class="mui-table-view-cell mui-media mui-col-xs-12" style="padding-right: 2px;">
+			<a href="#" class="proceId">
+				<div class="index-pro-tit">[精选] Aiberle美国智能净饮水一体机</div>
+			</a>
+		</li>
+		<li>
+			<div class="index-title">
+				<p class="giftId"><span class="iconfont icon-liwu"></span></p>
 			</div>
-			</div>
-			<ul class="mui-table-view mui-grid-view my-view-no" style="padding-bottom: 0;">
-		        <li class="mui-table-view-cell mui-media mui-col-xs-12" style="padding-right: 2px;">
-		            <a href="#">
-		                <div class="index-pro-tit">[精选] Aiberle美国智能净饮水一体机</div>
-		                <p class="mui-text-left">4级ro净化、10s加热、3s出水<span style="float: right;color: #ff3b3b;">¥2999.00</span></p>
-		            </a>
-		        </li>
-		        <li>
-		        	<div class="index-title">
-				<p><span class="iconfont icon-liwu"></span>美国aiberle咖啡杯、美国aiberle加湿器</p>
-			</div>
-		        </li>
-		        <li class="mui-table-view-cell mui-media mui-col-xs-12">
-		            <a href="#"><img class="mui-media-object" src="images/details-1.jpg">
-		            </a>
-		        </li>
-		   </ul>
-		</div>
-		<!-- 加载ing -->
-		<div class="loading covers">
-			<div class="loading-bj"></div>
-			<p>加载中...</p>
-		</div>
-		<!-- 加载ing END -->
-		<script src="js/mui.min.js"></script>
-		<script src="js/jquery-2.1.1.min.js"></script>
-		<script src="js/main.js"></script>
-		<script>
-			mui.ready(function() {
-				var slider = mui("#slider");
-				slider.slider({
-					interval: 5000
-				});
-				$(".loading").hide().css("opacity", "0");
-			});
-		</script>
-	</body>
+		</li>
+		<li class="mui-table-view-cell mui-media mui-col-xs-12">
+			<a href="#" class="product-param-img">
+				<img class="mui-media-object" src="images/details-1.jpg">
+			</a>
+		</li>
+	</ul>
+</div>
+<!-- 加载ing -->
+<div class="loading covers">
+	<div class="loading-bj"></div>
+	<p>加载中...</p>
+</div>
+<!-- 加载ing END -->
+<script src="//s.iamberry.com/wechat/aiberle/js/mui.min.js"></script>
+<script src="//s.iamberry.com/wechat/aiberle/js/jquery-2.1.1.min.js"></script>
+<script src="//s.iamberry.com/wechat/aiberle/js/main.js"></script>
+<script>
+    mui.ready(function() {
+        var nowUrl = location.href;
+        var productId = getParam("productId");
+        param = nowUrl.split("?")[1];
+        // 获取产品信息
+        selectProductInfo(productId);
+        $(".loading").hide();
+    });
+
+    // 产品基本信息
+    function selectProductInfo(productId) {
+        var btnArray = ['否', '是'];
+        mui.ajax('http://test.iamberry.com/iamberry/wechat/product/getProductByProductId?productId=' + productId + '&dates=' + new Date().getTime(), {
+            dataType: 'json',
+            async: false,
+            type: 'GET',
+            timeout: 15000,
+            success: function(dt) {
+                if (dt.isRedirect){
+                    window.location.href = dt.redirectURL;
+                    return;
+                }
+                //console.log(dt)
+                if(dt.status) {
+                    goodStatus = false;
+                    shareOpenid = dt.data.shareOpenid;
+                    /*var imageNote = "<div class='mui-slider-item mui-slider-item-duplicate'>" + "<a href='#'>" + "<img src='" + dt.data.product.pictureList[0].pictureUrl + "'>" + "</a>" + "</div>";
+                    for(var i = 0; i < dt.data.product.pictureList.length; i++) {
+                        imageNote += "<div class='mui-slider-item'>" + "<a href='#'>" + "<img src='" + dt.data.product.pictureList[i].pictureUrl + "'>" + "</a>" + "</div>";
+                        if(i == 0) {
+                            $("#active-div").append("<div class='mui-indicator mui-active'></div>");
+                        } else {
+                            $("#active-div").append("<div class='mui-indicator'></div>");
+                        }
+                    }
+                    imageNote += "<div class='mui-slider-item mui-slider-item-duplicate'>" + "<a href='#'>" + "<img src='" + dt.data.product.pictureList[0].pictureUrl + "'>" + "</a>" + "</div>";
+                    $("#group-images-div").append(imageNote);
+                    var banner = mui('#slider');
+                    banner.slider({
+                        interval: 5000
+                    });*/
+//遍历banner
+                    var bannerstr = "",dian = "";
+                    var banner_data = dt.data.product.pictureList;
+                    mui(banner_data).each(function(index) {
+                        if(index == 0) {
+                            bannerstr += '<div class="mui-slider-item mui-slider-item-duplicate"><a href="' + banner_data[banner_data.length - 1].pictureUrl + '"><img src="' + (banner_data[banner_data.length - 1].pictureUrl) + '"></a></div><div class="mui-slider-item mui-active"><a href="#"><img src="' + (this.pictureUrl) + '"></a></div>';
+                            dian += '<div class="mui-indicator mui-active"></div>'
+                        } else {
+                            bannerstr += '<div class="mui-slider-item"><a href="#"><img src="' + (this.pictureUrl) + '"></a></div>';
+                            dian += '<div class="mui-indicator"></div>'
+                        }
+                        if(index == (banner_data.length - 1) || (banner_data.length - 1) == 0) {
+                            bannerstr += '<div class="mui-slider-item mui-slider-item-duplicate"><a href="#"><img src="' + (banner_data[0].pictureUrl) + '"></a></div>'
+                        }
+                    });
+                    dc('mui-slider-loop').innerHTML = bannerstr;
+                    dc('my-slider-indicator').innerHTML = dian;
+                    $("<div id='slider' class='mui-slider'><div class='mui-slider-group mui-slider-loop' id='mui-slider-loop'>" + bannerstr + "</div><div id='my-slider-indicator' class='mui-slider-indicator my-slider-indicator'>" + dian + "</div></div>").insertBefore(".banner-box-pro");
+
+                    //初始化banner自动轮播(interval:0为不自动轮播)单位ms
+                    var banner = mui('#slider');
+                    banner.slider({
+                        interval: 5000
+                    });
+                    $("#product-name-font").html(dt.data.product.productColorList[0].colorProductName);
+                    var productName = dt.data.product.productName;
+                    if(dt.data.product.productChoiceness != 0){
+                        productName = productName;
+					}
+            		$(".index-pro-tit").html(productName);
+					$(".proceId").append('<p class="mui-text-left">'+dt.data.product.productColorDes+'<span style="float: right;color: #ff3b3b;">'+"¥" + (dt.data.product.productColorList[0].colorDiscount/100).toFixed(2)+'</span></p>');
+                    var gift = "";
+					$.each(dt.data.product.productColorList[0].salesUserGiftList,function () {
+					    if(gift == ""){
+                            gift = this.giftName;
+						}else{
+                            gift = gift +"、" +this.giftName;
+						}
+                    });
+					$(".giftId").append(gift);
+                    selectProductImageText(productId);
+                    if(dt.data.product.productStatus == 1) {
+                        pStatus = true;
+                    } else {
+                        pStatus = false;
+                    }
+                } else {
+                    mui.confirm(dt.message + '是否重新加载页面?', '提示', btnArray, function(e) {
+                        if(e.index == 1) {
+                            location.reload(true);
+                        }
+                    });
+                }
+            },
+            error: function(xhr, type, errorThrown) {
+                errorfn(xhr);
+            }
+        });
+    }
+
+    // 获取产品详情
+    function selectProductImageText(productId) {
+        var btnArray = ['否', '是'];
+        mui.ajax('/iamberry/wechat/product/getPictureByProductId?productId=' + productId, {
+            dataType: 'json',
+            type: 'POST',
+            timeout: 15000,
+            success: function(dt) {
+                if(dt.status) {
+                    //console.log(dt.data)
+                    if(dt.data != null) {
+                        /*$("#item2").html(dt.data.imagetextContext);*/
+                        $(".product-param-img").html(dt.data.imagetextContext);
+                    } else {
+                        $(".product-param-img").empty();
+                        mui.alert('商品详情获取失败');
+                    }
+                } else {
+                    mui.confirm(dt.message + '是否刷新页面?', '提示', btnArray, function(e) {
+                        if(e.index == 1) {
+                            location.reload(true);
+                        }
+                    });
+                }
+            },
+            error: function(xhr, type, errorThrown) {
+                mui.confirm('您的网络开小差了,是否重新加载页面?', '提示', btnArray, function(e) {
+                    if(e.index == 1) {
+                        location.reload(true);
+                    }
+                });
+            }
+        });
+    }
+</script>
+</body>
 
 </html>

+ 5 - 1
watero-common-tool/src/main/java/com/iamberry/wechat/tools/ResultInfo.java

@@ -73,7 +73,11 @@ public class ResultInfo {
 	/**
 	 * 定时任务返利模板
 	 */
-	public static String rebateOrderText = "";												
+	public static String rebateOrderText = "";
+	/**
+	 * 生成电动牙刷二维码保存路径
+	 */
+	public static String ROOT_DIRECTORY = "https://rst.iamberry.com";
 	/**
 	 * 下载二维码图片保存路径
 	 */

+ 10 - 0
watero-rst-core/src/main/java/com.iamberry.rst.core/cm/CustomerCommon.java

@@ -81,6 +81,8 @@ public class CustomerCommon implements Serializable {
     private Integer detectState;
     //外部交易号
     private String transactionNumber;
+    //  处理结果: 1:已解决  2:未解决 3:换新  4:维修 5:补发 6:退货 7:无理由退货
+    private Integer customerIsSolve;
 
     public Integer getDetectState() {
         return detectState;
@@ -362,6 +364,14 @@ public class CustomerCommon implements Serializable {
         this.transactionNumber = transactionNumber;
     }
 
+    public Integer getCustomerIsSolve() {
+        return customerIsSolve;
+    }
+
+    public void setCustomerIsSolve(Integer customerIsSolve) {
+        this.customerIsSolve = customerIsSolve;
+    }
+
     /**
      * @param type 处理结果: 1:已解决  2:未解决 3:换新  4:维修 5:补发 6:退货 7:无理由退货
      * @return

+ 4 - 1
watero-rst-core/src/main/java/com.iamberry.rst.core/cm/QuestionDescribe.java

@@ -15,7 +15,10 @@ public class QuestionDescribe implements Serializable {
     //   客诉主键  ,
     private Integer customerId;
 
-    //处理描述:用于新建客诉的时候的处理描述----> 客服备注 --> 问题描述
+    /**
+     * 处理描述:用于新建客诉的时候的处理描述----> 客服备注 --> 问题描述
+     * 问题描述详情,内部使用,不会对外公布。
+     */
     private String describeHandleDesc;
 
     private String describeTitle;   //客诉标题

+ 44 - 0
watero-rst-interface/src/main/java/com/iamberry/rst/faces/cm/CustomerCommonService.java

@@ -0,0 +1,44 @@
+package com.iamberry.rst.faces.cm;
+
+import com.iamberry.rst.core.cm.*;
+
+import java.util.List;
+
+public interface CustomerCommonService {
+    /**
+     * 获取寄回配件
+     * @param closedFitting
+     * @return
+     */
+    List<ClosedFitting> listClosedFitting(ClosedFitting closedFitting);
+
+    /**
+     * 获取寄回产品
+     * @param closedProdcue
+     * @return
+     */
+    List<ClosedProdcue> listClosedProdcue(ClosedProdcue closedProdcue);
+
+    /**
+     * 获取寄送产品
+     * @param sendProdcue
+     * @return
+     */
+    List<SendProdcue> listSendProdcue(SendProdcue sendProdcue);
+
+    /**
+     * 获取寄送配件
+     * @param sendFitting
+     * @return
+     */
+    List<SendFitting> listSendFitting(SendFitting sendFitting);
+
+    /**
+     * 获取寄送寄回的产品和配件
+     * @param customerCommon
+     * @return
+     */
+    CustomerCommon getListProduceAndFitting(CustomerCommon customerCommon);
+
+
+}

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

@@ -10,6 +10,13 @@ import java.util.List;
 public interface QuestionDescribeService {
 
     /**
+     * 根据id查询问题描述
+     * @param describeId
+     * @return
+     */
+    QuestionDescribe getQuestionDescribe(Integer describeId);
+
+    /**
      * 查询问题集合
      * @param record
      * @return

+ 80 - 0
watero-rst-service/src/main/java/com/iamberry/rst/service/cm/CustomerCommonServiceImpl.java

@@ -0,0 +1,80 @@
+package com.iamberry.rst.service.cm;
+
+import com.iamberry.rst.core.cm.*;
+import com.iamberry.rst.faces.cm.CustomerCommonService;
+import com.iamberry.rst.service.cm.mapper.*;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+@Service
+public class CustomerCommonServiceImpl implements CustomerCommonService {
+
+    @Autowired
+    private CustomerCommonService customerCommonService;
+    @Autowired
+    private RepairMapper repairMapper;
+    @Autowired
+    private BackGoodsMapper backGoodsMapper;
+    @Autowired
+    private NoreasonBackMapper noreasonBackMapper;
+    @Autowired
+    private ReissueMapper reissueMapper;
+    @Autowired
+    private RenewedMapper renewedMapper;
+    @Autowired
+    private ClosedFittingMapper closedFittingMapper;
+    @Autowired
+    private ClosedProdcueMapper closedProdcueMapper;
+    @Autowired
+    private SendProdcueMapper sendProdcueMapper;
+    @Autowired
+    private SendFittingMapper sendFittingMapper;
+
+
+    @Override
+    public List<ClosedFitting> listClosedFitting(ClosedFitting closedFitting) {
+        return closedFittingMapper.listClosedFitting(closedFitting);
+    }
+
+    @Override
+    public List<ClosedProdcue> listClosedProdcue(ClosedProdcue closedProdcue) {
+        return closedProdcueMapper.listclosedProdcue(closedProdcue);
+    }
+
+    @Override
+    public List<SendProdcue> listSendProdcue(SendProdcue sendProdcue) {
+        return sendProdcueMapper.listSendProdcue(sendProdcue);
+    }
+
+    @Override
+    public List<SendFitting> listSendFitting(SendFitting sendFitting) {
+        return sendFittingMapper.listSendFitting(sendFitting);
+    }
+
+    @Override
+    public CustomerCommon getListProduceAndFitting(CustomerCommon customerCommon) {
+        ClosedFitting closedFitting = new ClosedFitting();
+        closedFitting.setClosedFittingType(customerCommon.getCustomerIsSolve());
+        closedFitting.setRelationId(customerCommon.getRelationId());
+        customerCommon.setClosedFittings(customerCommonService.listClosedFitting(closedFitting));
+
+        ClosedProdcue closedProdcue = new ClosedProdcue();
+        closedProdcue.setClosedProdcueType(customerCommon.getCustomerIsSolve());
+        closedProdcue.setRelationId(customerCommon.getRelationId());
+        customerCommon.setClosedProdcues(customerCommonService.listClosedProdcue(closedProdcue));
+
+        SendProdcue sendProdcue = new SendProdcue();
+        sendProdcue.setSendProduceType(customerCommon.getCustomerIsSolve());
+        sendProdcue.setRelationId(customerCommon.getRelationId());
+        customerCommon.setSendProdcues(customerCommonService.listSendProdcue(sendProdcue));
+
+        SendFitting sendFitting = new SendFitting();
+        sendFitting.setSendFittingType(customerCommon.getCustomerIsSolve());
+        sendFitting.setRelationId(customerCommon.getRelationId());
+        customerCommon.setSendFittings(customerCommonService.listSendFitting(sendFitting));
+
+        return customerCommon;
+    }
+}

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

@@ -18,6 +18,11 @@ public class QuestionDescribeServiceImpl implements QuestionDescribeService {
     private QuestionDescribeMapper questionDescribeMapper;
 
     @Override
+    public QuestionDescribe getQuestionDescribe(Integer describeId) {
+        return questionDescribeMapper.selectByPrimaryKey(describeId);
+    }
+
+    @Override
     public List<QuestionDescribe> listQuestionDescribe(QuestionDescribe record) {
         return questionDescribeMapper.listQuestionDescribe(record);
     }

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

@@ -24,10 +24,19 @@
   </sql>
   <select id="getQuestionById" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
     select 
-    <include refid="Base_Column_List" />
-    ,
-    <include refid="Blob_Column_List" />
-    from tb_rst_complaint_question
+        t.question_id,
+        t.small_class_id,
+        t.question_name,
+        t.question_profile,
+        t.question_state,
+        t.question_is_qc_detect,
+        t.question_resolved_num,
+        t.question_not_solved_num,
+        t.question_create_time,
+        t.question_update_time,
+        sc.complaint_id
+    from tb_rst_complaint_question t
+    LEFT JOIN tb_rst_complaint_small_class sc ON  t.small_class_id = sc.small_class_id
     where question_id = #{questionId,jdbcType=INTEGER}
   </select>
 

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

@@ -29,10 +29,29 @@
   <!-- 根据id获取客诉信息 -->
   <select id="getCustomerInfo" resultType="CustomerInfo" parameterType="java.lang.Integer" >
     select 
-    <include refid="Base_Column_List" />
-    from tb_rst_customer_info
-    where customer_id = #{customerId,jdbcType=INTEGER}
+      t.customer_id,
+      t.admin_id,
+      t.question_id,
+      t.company_id,
+      t.store_id,
+      t.customer_source_type,
+      t.customer_source,
+      t.customer_counsel_type,
+      t.type_id,
+      t.customer_name,
+      t.customer_tel,
+      t.customer_is_solve,
+      t.customer_is_visit,
+      t.customer_in_TDS,
+      t.customer_out_TDS,
+      t.customer_area,
+      t.customer_create_time,
+      t.customer_update_time,
+      t.customer_question_title
+    from tb_rst_customer_info t
+    where t.customer_id = #{customerId,jdbcType=INTEGER}
   </select>
+
   <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
     delete from tb_rst_customer_info
     where customer_id = #{customerId,jdbcType=INTEGER}

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

@@ -7,7 +7,12 @@
     <result column="customer_id" property="customerId" jdbcType="INTEGER" />
   </resultMap>
   <sql id="Base_Column_List" >
-    describe_id, describe_content, customer_id
+      describe_id,
+      describe_content,
+      customer_id,
+      describe_title,
+      describe_handle_desc,
+      describe_create_time
   </sql>
   <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
     select 

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

@@ -33,20 +33,23 @@
     <result column="sales_type" property="salesType" jdbcType="INTEGER" />
   </resultMap>
   <sql id="salesOrderInfo" >
-    sales_id, sales_orderId, sales_openId, sales_discount_money, sales_pledge_money, 
-    sales_remain_deposit, sales_status, sales_send_type, sales_send_time, sales_sales_time, 
-    sales_post_num, sales_post_firm, sales_address_info, sales_address_tel, sales_address_name, 
-    sales_amount, sales_pay_money, sales_pay_type, sales_wait_money, sales_last_money, 
-    sales_shipping_fee, sales_pay_time, sales_create_time, sales_admin_remark, sales_user_remark, 
-    sales_pay_number, sales_store_id, sales_company_id, sales_type
+        sales_id,sales_orderId,sales_openId,sales_discount_money,sales_pledge_money,sales_remain_deposit,
+        sales_send_type,sales_send_time,sales_sales_time,sales_post_num,sales_post_firm,sales_address_info,sales_address_tel,
+        sales_address_name,sales_amount,sales_pay_money,sales_pay_type,sales_wait_money,sales_last_money,sales_shipping_fee,sales_pay_time,
+        sales_create_time,sales_admin_remark,sales_user_remark,sales_pay_number,sales_store_id,sales_company_id,sales_type,sales_deal_code,sales_order_status,
+        sales_status,sales_shipping_status,sales_pay_status,sales_process_status,sales_is_send,sales_is_locked,sales_is_separate
   </sql>
 
   <!-- 根据id查询订单信息 -->
   <select id="getSalesOrderById" resultType="SalesOrder" parameterType="java.lang.Integer" >
     select 
-      *
-    from tb_rst_sales_order_info
-    where sales_id = #{salesId,jdbcType=INTEGER}
+      	t.*,
+      	trsc.company_name companyName,
+        trsi.store_name  storeName
+    from tb_rst_sales_order_info t
+    LEFT JOIN tb_rst_sales_company trsc ON t.sales_company_id = trsc.company_id
+    LEFT JOIN tb_rst_store_info trsi ON t.sales_store_id = trsi.store_id
+    where sales_id = #{salesId}
   </select>
 
   <!-- 订单集合 -->
@@ -83,9 +86,6 @@
       <if test="salesAddressName !=null and salesAddressName !=''">
         AND sales_address_name like CONCAT('%',#{salesAddressName},'%')
       </if>
-      <if test="salesCreateTime != null and salesCreateTime != ''">
-        AND sales_create_time <![CDATA[>=]]> #{salesCreateTime}
-      </if>
       <if test="startDate != null and startDate != ''">
         AND sales_create_time <![CDATA[>=]]> #{startDate}
       </if>

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

@@ -18,9 +18,22 @@
     <result column="visit_update_time" property="visitUpdateTime" jdbcType="TIMESTAMP" />
   </resultMap>
   <sql id="Base_Column_List" >
-    visit_id, customer_id, admin_id, visit_name, visit_tel, visit_date, visit_time_select, 
-    visit_status, visit_complete_date, visit_complete_name, visit_complete_tel, visit_complete_remark, 
-    visit_create_time, visit_update_time
+      visit_id,
+      customer_id,
+      admin_id,
+      designated_admin_id,
+      visit_name,
+      visit_tel,
+      visit_date,
+      visit_time_select,
+      visit_status,
+      visit_complete_date,
+      visit_complete_name,
+      visit_complete_tel,
+      visit_complete_remark,
+      visit_complete_sex,
+      visit_create_time,
+      visit_update_time
   </sql>
   <select id="getVisit" resultMap="BaseResultMap" parameterType="Visit" >
     select 

+ 88 - 8
watero-rst-web/src/main/java/com/iamberry/rst/controllers/cm/AdminCustomerController.java

@@ -81,6 +81,10 @@ public class AdminCustomerController {
     private SmsService smsService;
     @Autowired
     private ComplaintSignclosedInfoService complaintSignclosedInfoService;
+    @Autowired
+    private ComplaintSmallClassInfoService complaintSmallClassInfoService;
+    @Autowired
+    private CustomerCommonService customerCommonService;
 
 
     /**
@@ -148,37 +152,68 @@ public class AdminCustomerController {
         Integer loginAdminId = AdminUtils.getLoginAdminId();
         //查询客诉基本信息
         CustomerInfo customerInfo = customerService.getCustomerInfo(customerId);
+        CustomerCommon customerCommon = new CustomerCommon();
         if(customerInfo.getCustomerIsSolve() != null){
-            CustomerCommon customerCommon = new CustomerCommon();
             switch (customerInfo.getCustomerIsSolve()){   //处理结果: 1:已解决  2:未解决 3:换新  4:维修 5:补发 6:退货 7:无理由退货
                 case 3://获取换新
                     Renewed renewed = new Renewed();
                     renewed.setCustomerId(customerInfo.getCustomerId());
                     renewed = renewedService.getRenewed(renewed);
-                    customerCommon.getCustomerCommon(3,renewed);
+                    customerCommon = customerCommon.getCustomerCommon(3,renewed);
                     break;
                 case 4://维修
                     Repair repair = new Repair();
                     repair.setCustomerId(customerInfo.getCustomerId());
                     repair = repairService.getRepair(repair);
-                    customerCommon.getCustomerCommon(4,repair);
+                    customerCommon = customerCommon.getCustomerCommon(4,repair);
+                    break;
                 case 5:
                     Reissue reissue = new  Reissue();
                     reissue.setCustomerId(customerInfo.getCustomerId());
                     reissue = reissueService.getReissue(reissue);
-                    customerCommon.getCustomerCommon(5,reissue);
+                    customerCommon = customerCommon.getCustomerCommon(5,reissue);
+                    break;
                 case 6:
                     BackGoods backGoods = new  BackGoods();
                     backGoods.setCustomerId(customerInfo.getCustomerId());
                     backGoods = backGoodsService.getBackGoods(backGoods);
-                    customerCommon.getCustomerCommon(6,backGoods);
+                    customerCommon = customerCommon.getCustomerCommon(6,backGoods);
+                    break;
                 case 7:
                     NoreasonBack noreasonBack = new  NoreasonBack();
                     noreasonBack.setCustomerId(customerInfo.getCustomerId());
                     noreasonBack = noreasonBackService.getNoreasonBack(noreasonBack);
-                    customerCommon.getCustomerCommon(7,noreasonBack);
+                    customerCommon = customerCommon.getCustomerCommon(7,noreasonBack);
+                    break;
             }
+
+            /*查询所有需要寄入寄出的产品*/
+            customerCommon.setCustomerIsSolve(customerInfo.getCustomerIsSolve());
+            customerCommon = customerCommonService.getListProduceAndFitting(customerCommon);
             mv.addObject("customerCommon", customerCommon);
+
+            /*查询所有的产品,颜色和配件信息*/
+            List<Product> productList = productService.listProduce(new Product());
+            for(Product product : productList){
+                ProductColor productColor = new ProductColor();
+                productColor.setColorProductId(product.getProductId());
+                List<ProductColor>  productColorList = productService.listProduceColor(productColor);
+                product.setColorList(productColorList);
+
+                FittingsInfo fittingsInfo = new FittingsInfo();
+                fittingsInfo.setProductId(product.getProductId());
+                List<FittingsInfo> fittingsInfoList = fittingsInfoService.listFittings(fittingsInfo);
+                product.setFittingsList(fittingsInfoList);
+            }
+            mv.addObject("productList", productList);
+
+            /*查询订单信息*/
+            SalesOrder salesOrder = salesOrderService.getSalesOrderById(customerCommon.getOrderId());
+            SalesOrderItem salesOrderItem = new SalesOrderItem();
+            salesOrderItem.setItemOrderId(salesOrder.getSalesId());
+            List<SalesOrderItem> salesOrderItemList = salesOrderService.listSalesOrderItem(salesOrderItem);
+            salesOrder.setSalesOrderItemList(salesOrderItemList);
+            mv.addObject("salesOrder", salesOrder);
         }
         if ("2".equals(customerInfo.getCustomerIsVisit())){ //1:不需要回访  2:需要回访
             Visit visit = new Visit();
@@ -187,15 +222,53 @@ public class AdminCustomerController {
             mv.addObject("visit", visit);
         }
 
+        //查询关联问题
+        ComplaintQuestionInfo complaintQuestionInfo = complaintQuestionInfoService.getQuestionById(customerInfo.getQuestionId());
+        //查询问题小类
+        ComplaintSmallClassInfo complaintSmallClassInfo = new ComplaintSmallClassInfo();
+        complaintSmallClassInfo.setComplaintId(complaintQuestionInfo.getComplaintId());
+        List<ComplaintSmallClassInfo> complaintSmallClassInfoList = complaintSmallClassInfoService.listComplaintSmallClassInfo(complaintSmallClassInfo);
+        //查询问题大类
+        ComplaintTypeInfo complaintTypeInfo = new ComplaintTypeInfo();
+        List<ComplaintTypeInfo> complaintTypeInfoList = complaintTypeInfoService.listComplaintTypeInfo(complaintTypeInfo);
+
+
+        mv.addObject("customerInfo", customerInfo);
         mv.addObject("typeList", typeList);
         mv.addObject("complaintTypeList", complaintTypeList);
         mv.addObject("complaintTypeList", complaintTypeList);
         mv.addObject("adminList", adminList);
         mv.addObject("loginAdminId", loginAdminId);
+        mv.addObject("complaintQuestionInfo", complaintQuestionInfo);
+        mv.addObject("complaintSmallClassInfoList", complaintSmallClassInfoList);
+        mv.addObject("complaintTypeInfoList", complaintTypeInfoList);
+        //mv.addObject("questionDescribe", questionDescribe);
         return mv;
     }
 
     /**
+     * 查询问题描述
+     * @return
+     */
+    @ResponseBody
+    @RequiresPermissions("customer:add:customer")
+    @RequestMapping(value = "/select_question_describe")
+    public ResponseJson selectQuestionDescribe(HttpServletRequest request, Integer customerId) throws Exception {
+        if(customerId == null || customerId == 0){
+            return new ResponseJson(500, "未获取到问题描述", 500);
+        }
+        //查询问题描述表
+        QuestionDescribe questionDescribe = new QuestionDescribe();
+        questionDescribe.setCustomerId(customerId);
+        questionDescribe = questionDescribeService.listQuestionDescribe(questionDescribe).get(0);
+
+        ResponseJson rj = new ResponseJson(200, "查询成功", 200);
+        rj.addResponseKeyValue("questionDescribe", questionDescribe);
+        return rj;
+    }
+
+
+    /**
      * 搜索订单列表弹出框
      *
      * @return
@@ -349,8 +422,15 @@ public class AdminCustomerController {
     @ResponseBody
     @RequiresPermissions("customer:add:customer")
     @RequestMapping(value = "/select_salesOrder")
-    public ResponseJson listOrder(HttpServletRequest request, SalesOrder salesOrder) {
-        List<SalesOrder> salesOrderList = salesOrderService.listSalesOrder(salesOrder);
+    public ResponseJson listOrder(HttpServletRequest request, SalesOrder salesOrder,
+                @RequestParam(value = "pageSize", defaultValue = "10", required = false) Integer pageSize,
+                @RequestParam(value = "pageNO", defaultValue = "1", required = false) Integer pageNO,
+                @RequestParam(value = "totalNum", defaultValue = "0", required = false) Integer totalNum) {
+
+        //分页获取订单信息
+        PagedResult<SalesOrder> pagedResult = salesOrderService.listSalesOrderPage(pageNO, pageSize, salesOrder, totalNum == 0);
+
+        List<SalesOrder> salesOrderList = pagedResult.getDataList();
 
         for (SalesOrder order : salesOrderList) {
             SalesOrderItem salesOrderItem = new SalesOrderItem();

+ 3 - 4
watero-rst-web/src/main/java/com/iamberry/rst/controllers/pts/AdminMachineController.java

@@ -714,9 +714,7 @@ public class AdminMachineController {
         Calendar nowDate = Calendar.getInstance();
         Integer year = nowDate.get(Calendar.YEAR);
         Integer month = nowDate.get(Calendar.MONTH) + 1;
-        if(year == 2017 && month == 12){
-            machineNumber += 300;
-        }
+
         String num = null;
         for (int i = 0; i < number; i++) {
             machineNumber++;
@@ -755,7 +753,8 @@ public class AdminMachineController {
                 }
                     if(bl){
                         StringBuffer url = request.getRequestURL();
-                        String tempContextUrl = url.delete(url.length() - request.getRequestURI().length(), url.length()).append(request.getContextPath()).append("/").toString();
+                        //String tempContextUrl = url.delete(url.length() - request.getRequestURI().length(), url.length()).append(request.getContextPath()).append("/").toString();
+                        String tempContextUrl = ResultInfo.ROOT_DIRECTORY;
                         qrCodeUrl = tempContextUrl +ResultInfo.QRCODE_TOOTH_IMAGE+ "/"+berQrcode+num+".png";
                     }
             }else{

+ 1 - 0
watero-rst-web/src/main/resources/platform.properties

@@ -80,6 +80,7 @@ appId=wxc71b789fad06a2d7
 appSecret=8a90e3ab0e2db7772f5f64e7ed2f4b98
 # appSecret-wateroPF
 #appSecret=e3b11ca050578ac8b794b510b16b2020
+
 SUCCESSINFO=SUCCESS
 
 #cm-website-send-msg

+ 1 - 1
watero-rst-web/src/main/webapp/WEB-INF/views/cm/customer/add_customer.ftl

@@ -465,7 +465,7 @@
                 <div class="row cl">
                     <label class="form-label col-1 col-sm-1"><span class="c-red">*</span>被回访人:</label>
                     <div class="formControls col-2 col-sm-2">
-                        <input type="text" class="input-text" value="" placeholder="填写回访人姓名" id="" name="visitName"  datatype="s1-20" errormsg="回访人姓名格式不正确!" >
+                        <input type="text" class="input-text" value="" placeholder="填写回访人姓名" id="" name="visitName"  datatype="/^[\u4e00-\u9fa5]{1,20}$/" errormsg="回访人姓名格式不正确!" >
                     </div>
                     <div class="formControls col-2 col-sm-2">
                         <input type="text" class="input-text associated-phone" value="" placeholder="填写回访人手机号" id="" name="visitTel" datatype="m" errormsg="回访人手机号码格式不正确!">

+ 236 - 77
watero-rst-web/src/main/webapp/WEB-INF/views/cm/customer/update_customer.ftl

@@ -69,11 +69,11 @@
     <div class="pd-20 cl">
         <form action="${path}/admin/customer/save_customer" method="post" class="form form-horizontal" id="form-customer-add"  onkeydown="if(event.keyCode==13)return false;">
 
+            <input type="hidden" id="customerId" name="customerId" value="${customerInfo.customerId!''}">
             <input type="hidden" id="customerName" name="customerName" value="">
             <input type="hidden" id="customerTel" name="customerTel" value="">
 
             <div class="row cl">
-
                 <label class="form-label col-3">
                     <div class="tit-2">客诉基本信息</div>
                 </label>
@@ -84,6 +84,9 @@
                 <label class="form-label col-1 col-sm-1"><span class="c-red">*</span>跟进客服:</label>
                 <div class="formControls col-4 col-sm-4"> <span class="select-box" style=" width: 625px;">
                     <select name="adminId" id="adminId" class="select">
+                        <#list adminList as admin>
+                            <option value ="${admin.adminId!}" <#if customerInfo.adminId??><#if customerInfo.adminId == admin.adminId >selected="selected"</#if></#if>>${admin.adminName!}</option>
+                        </#list>
                     </select>
 				</span>
                 </div>
@@ -92,18 +95,18 @@
                 <label class="form-label col-1 col-sm-1"><span class="c-red">*</span>来源入口:</label>
                 <div class="formControls col-10 col-sm-10 skin-minimal">
                     <div class="radio-box">
-                        <input type="radio" id="tel-1" name="customerSourceType" value="1" >
+                        <input type="radio" id="tel-1" name="customerSourceType" value="1" <#if customerInfo.customerSourceType == 1 >checked</#if>>
                         <label for="tel-1">400电话</label>
                     </div>
                     <div class="radio-box">
-                        <input type="radio" id="tel-2" name="customerSourceType" value="2" checked>
+                        <input type="radio" id="tel-2" name="customerSourceType" value="2" <#if customerInfo.customerSourceType == 2 >checked</#if>>
                         <label for="tel-2">微信公众号</label>
                     </div>
                     <div class="radio-box">
-                        <input type="radio" id="tel-3" name="customerSourceType" value="3">
+                        <input type="radio" id="tel-3" name="customerSourceType" value="3" <#if customerInfo.customerSourceType == 3 >checked</#if>>
                         <label for="tel-3">其他</label>
-                        <input type="text" style="width: 321px;margin-left: 10px; display: none;" class="input-text" value="" placeholder="" id="customerSourceOld" name="customerSourceOld" placeholder="">
-                        <input type="hidden" value="" placeholder="" id="customerSource" name="customerSource">
+                        <input type="text" style="width: 321px;margin-left: 10px; <#if customerInfo.customerSourceType != 3 >display: none;</#if>" class="input-text" value="" placeholder="" id="customerSourceOld" name="customerSourceOld" placeholder="">
+                        <input type="hidden" value="${customerInfo.customerSource!''}" placeholder="" id="customerSource" name="customerSource"  >
                     </div>
                 </div>
             </div>
@@ -111,11 +114,11 @@
                 <label class="form-label col-1 col-sm-1"><span class="c-red">*</span>咨询类型:</label>
                 <div class="formControls col-10 col-sm-10 skin-minimal">
                     <div class="radio-box">
-                        <input type="radio" class="customerCounselType" id="customer-type-1" name="customerCounselType" value="1"  >
+                        <input type="radio" class="customerCounselType" id="customer-type-1" name="customerCounselType" value="1"  <#if customerInfo.customerCounselType == 1 >checked</#if>>
                         <label for="customer-type-1">售前咨询</label>
                     </div>
                     <div class="radio-box">
-                        <input type="radio" class="customerCounselType" id="customer-type-2" name="customerCounselType" value="2"  checked>
+                        <input type="radio" class="customerCounselType" id="customer-type-2" name="customerCounselType" value="2"  <#if customerInfo.customerCounselType == 2 >checked</#if>>
                         <label for="customer-type-2">售后咨询</label>
                     </div>
                 </div>
@@ -125,14 +128,12 @@
                 <label class="form-label col-1 col-sm-1"><span class="c-red">*</span>产品类型:</label>
                 <input type="hidden" id="typeCompany" name="typeCompany" value="">
                 <div class="formControls col-10 col-sm-10 skin-minimal" id="produceTypeHtml">
-                    <#--<div class="radio-box">
-                        <input type="radio" id="tel-3" name="produceType" datatype="*" nullmsg="请选择产品类型!">
-                        <label for="tel-3">净水机</label>
-                    </div>
-                    <div class="radio-box">
-                        <input type="radio" id="tel-3" name="produceType" datatype="*" nullmsg="请选择产品类型!">
-                        <label for="tel-4">冲奶机</label>
-                    </div>-->
+                    <#list typeList as type>
+                        <div class="radio-box">
+                            <input type="radio" id="produceType-${type_index}" name="produceType" value="${type.typeId!''}" <#if customerInfo.typeId == type.typeId>checked</#if> >
+                            <label for="produceType-${type_index}">${type.typeName!''}</label>
+                        </div>
+                    </#list>
                 </div>
             </div>
 
@@ -141,16 +142,18 @@
                 <div class="formControls col-2 col-sm-2"> <span class="select-box">
 				<select name="complaintId" class="select">
                     <option value="">请选择问题分类</option>
-					<#--<option value="0">使用操作</option>-->
-					<#--<option value="1">使用操作</option>-->
+                    <#list complaintTypeInfoList as complaintTypeInfo>
+                        <option value="${complaintTypeInfo.complaintId}" <#if complaintQuestionInfo.complaintId == complaintTypeInfo.complaintId>selected="selected"</#if> >${complaintTypeInfo.complaintClassName}</option>
+                    </#list>
 				</select>
 				</span>
                 </div>
                 <div class="formControls col-2 col-sm-2"> <span class="select-box">
 				<select name="smallClassId" id="smallClassId" class="select">
                     <option value="">请选择问题分类</option>
-					<#--<option value="0">使用操作制水出水</option>
-					<option value="1">使用操作制水出水</option>-->
+                    <#list complaintSmallClassInfoList as complaintSmallClassInfo>
+                        <option value="${complaintSmallClassInfo.smallClassId}" <#if complaintQuestionInfo.smallClassId == complaintSmallClassInfo.smallClassId>selected="selected"</#if>>${complaintSmallClassInfo.smallClassName}</option>
+                    </#list>
 				</select>
 				</span>
                 </div>
@@ -177,7 +180,7 @@
             <div class="row cl">
                 <label class="form-label col-1 col-sm-1"><span class="c-red">*</span>问题标题:</label>
                 <div class="formControls col-5 col-sm-5">
-                    <input type="text" class="input-text" style="width: 625px;" name="describeTitle" id="describeTitle" datatype="*1-50" errormsg="问题标题不正确!" >
+                    <input type="text" class="input-text" style="width: 625px;" name="describeTitle" id="describeTitle" datatype="*1-50" errormsg="问题标题不正确!" value="" >
                 </div>
             </div>
 
@@ -188,7 +191,7 @@
                     <span>问题描述详情,内部使用,不会对外公布。</span>
                     <script id="describeHandleDescText" type="text/plain" style="width:983px;height:250px;"></script>
                     </script>
-                    <input type="hidden" id="describeHandleDesc" name="describeHandleDesc">
+                    <input type="hidden" id="describeHandleDesc" name="describeHandleDesc" value="">
                 </div>
             </div>
 
@@ -204,7 +207,7 @@
             <div class="row cl">
                 <label class="form-label col-1 col-sm-1"></label>
                 <div class="formControls col-2 col-sm-2">
-                    <input type="text" class="input-text associated-phone" value="" placeholder="请输入手机号" id="p-phone" name="">
+                    <input type="text" class="input-text associated-phone" value="${customerInfo.customerTel!''}" placeholder="请输入手机号" id="p-phone" name="">
                 </div>
                 <div class="formControls col-2 col-sm-2" style="width: 10%">
                     <input type="button" class="btn btn-primary" value="发送问题回复给用户" onclick="sendPhone('p','p-msg');">
@@ -235,31 +238,31 @@
                 <label class="form-label col-1 col-sm-1">处理类型:</label>
                 <div class="formControls col-10 col-sm-10 skin-minimal">
                     <div class="radio-box" id="solved">
-                        <input type="radio" id="customer-process-1" value="1" name="customerIsSolve" >
+                        <input type="radio" id="customer-process-1" value="1" name="customerIsSolve"  <#if customerInfo.customerIsSolve == 1 >checked</#if> >
                         <label for="customer-process-1">已解决</label>
                     </div>
                     <div class="radio-box" id="noSolved">
-                        <input type="radio" id="customer-process-2" value="2" name="customerIsSolve">
+                        <input type="radio" id="customer-process-2" value="2" name="customerIsSolve" <#if customerInfo.customerIsSolve == 2 >checked</#if> >
                         <label for="customer-process-2">未解决</label>
                     </div>
                     <div class="radio-box" id="renewed" style="display: none">
-                        <input type="radio" id="customer-process-3" value="3" name="customerIsSolve" checked>
+                        <input type="radio" id="customer-process-3" value="3" name="customerIsSolve" <#if customerInfo.customerIsSolve == 3 >checked</#if> >
                         <label for="customer-process-3">换新</label>
                     </div>
                     <div class="radio-box" id="maintain" style="display: none">
-                        <input type="radio" id="customer-process-4" value="4" name="customerIsSolve" >
+                        <input type="radio" id="customer-process-4" value="4" name="customerIsSolve" <#if customerInfo.customerIsSolve == 4 >checked</#if> >
                         <label for="customer-process-4">维修</label>
                     </div>
                     <div class="radio-box" id="reissue" style="display: none">
-                        <input type="radio" id="customer-process-5" value="5" name="customerIsSolve">
+                        <input type="radio" id="customer-process-5" value="5" name="customerIsSolve" <#if customerInfo.customerIsSolve == 5 >checked</#if> >
                         <label for="customer-process-5">补发</label>
                     </div>
                     <div class="radio-box" id="backGoods" style="display: none">
-                        <input type="radio" id="customer-process-6" value="6" name="customerIsSolve">
+                        <input type="radio" id="customer-process-6" value="6" name="customerIsSolve" <#if customerInfo.customerIsSolve == 6 >checked</#if> >
                         <label for="customer-process-6">退货</label>
                     </div>
                     <div class="radio-box" id="noReasonBack" style="display: none">
-                        <input type="radio" id="customer-process-7" value="7" name="customerIsSolve">
+                        <input type="radio" id="customer-process-7" value="7" name="customerIsSolve" <#if customerInfo.customerIsSolve == 7 >checked</#if> >
                         <label for="customer-process-7">无理由退货</label>
                     </div>
                 </div>
@@ -281,7 +284,8 @@
             <div class="row cl" id="orderHead" style="display: none;">
                 <label class="form-label col-1 col-sm-1"><span class="c-red">*</span>订单信息:</label>
                 <div class="formControls col-1 col-sm-1">
-                    <button type="button" class="btn btn-primary" id="selectOrder">搜索订单</button>
+
+                    <#--<button type="button" class="btn btn-primary" id="selectOrder">搜索订单</button>-->
                 </div>
             </div>
             <div class="row cl" id="order" style="display: none;">
@@ -289,8 +293,10 @@
                 <div class="formControls col-9 col-sm-9 text-c">
                     <table class="table table-border table-bg table-bordered">
                         <tr>
-                            <th style="text-align: center;">销售</th>
-                            <th style="text-align: center;">订单号</th>
+                            <th style="text-align: center;">销售公司</th>
+                            <th style="text-align: center;">店铺名称</th>
+                            <th style="text-align: center;">Efast订单号</th>
+                            <th style="text-align: center;">交易号</th>
                             <th style="text-align: center;">姓名</th>
                             <th style="text-align: center;">电话</th>
                             <th style="text-align: center;">订单金额</th>
@@ -298,12 +304,24 @@
                             <th style="text-align: center;">购买日期</th>
                         </tr>
                         <tr id="showOrder">
-                            <td style="text-align: center;" colspan="7">暂未选择订单</td>
+                            <td style="text-align: center;">${salesOrder.companyName}</td>
+                            <td style="text-align: center;">${salesOrder.storeName}</td>
+                            <td style="text-align: center;">${salesOrder.salesOrderId}</td>
+                            <td style="text-align: center;">${salesOrder.salesDealCode}</td>
+                            <td style="text-align: center;">${salesOrder.salesAddressName}</td>
+                            <td style="text-align: center;">${salesOrder.salesAddressTel}</td>
+                            <td style="text-align: center;">${salesOrder.salesPayMoney}</td>
+                            <td style="text-align: center;">
+                                <#list salesOrder.salesOrderItemList as salesOrderItem>
+                                    ${salesOrderItem.itemProductName}* ${salesOrderItem.itemNum}<br>
+                                </#list>
+                            </td>
+                            <td style="text-align: center;">${(salesOrder.salesPayTime?string("yyyy-MM-dd HH:mm:ss"))!''}</td>
                         </tr>
                     </table>
-                    <input type="hidden" id="companyId" name="companyId" value="" >
-                    <input type="hidden" id="storeId" name="storeId" value="" >
-                    <input type="hidden" id="orderId" name="salesId" value="" >
+                    <input type="hidden" id="companyId" name="companyId" value="${salesOrder.salesCompanyId}" >
+                    <input type="hidden" id="storeId" name="storeId" value="${salesOrder.salesStoreId}" >
+                    <input type="hidden" id="orderId" name="salesId" value="${salesOrder.salesId}" >
                 </div>
             </div>
 
@@ -315,13 +333,13 @@
             <div class="row cl" id="recipientInfo" style="display: none;">
                 <label class="form-label col-1 col-sm-1"></label>
                 <div class="formControls col-2 col-sm-2">
-                    <input type="text" class="input-text" value="" placeholder="填写收件人姓名" id="sendName" name="relationSendName" datatype="/^[\u4e00-\u9fa5]{1,20}$/" errormsg="联系人格式不正确!" >
+                    <input type="text" class="input-text" value="${customerCommon.relationBackName}" placeholder="填写收件人姓名" id="sendName" name="relationSendName" datatype="/^[\u4e00-\u9fa5]{1,20}$/" errormsg="联系人格式不正确!" >
                 </div>
                 <div class="formControls col-2 col-sm-2">
-                    <input type="text" class="input-text" value="" placeholder="填写收件人手机号" id="sendTel" name="relationSendTel" datatype="m" errormsg="联系人电话格式不正确!">
+                    <input type="text" class="input-text" value="${customerCommon.relationBackTel}" placeholder="填写收件人手机号" id="sendTel" name="relationSendTel" datatype="m" errormsg="联系人电话格式不正确!">
                 </div>
                 <div class="formControls col-2 col-sm-2"  id="postageAccount">
-                    <input type="text" class="input-text" value="" placeholder="邮费转账 支付宝账户" id="relationAlipay" name="relationAlipay" errormsg="邮费转账账户!">
+                    <input type="text" class="input-text" value="${customerCommon.relationAlipay!''}" placeholder="邮费转账 支付宝账户" id="relationAlipay" name="relationAlipay" errormsg="邮费转账账户!">
                 </div>
             </div>
             <div class="row cl" id="recipientAddress" style="display: none;">
@@ -330,6 +348,7 @@
                 <div class="formControls col-2 col-sm-2">
                     <span class="select-box">
                          <select id="province" class="select" name="provinceNumber">
+
                          </select>
                      </span>
                 </div>
@@ -352,7 +371,7 @@
             <div class="row cl" id="recipientAddressText" style="display: none;">
                 <label class="form-label col-1 col-sm-1"></label>
                 <div class="formControls col-5 col-sm-5">
-                    <textarea name="relationSendAddress" id="sendAddress" cols="" rows="2" datatype="*" errormsg="收货地址不正确!" class="textarea" placeholder="请填写详细地址,最多支持50字符" onKeyUp="$.Huitextarealength(this,50)"></textarea>
+                    <textarea name="relationSendAddress" id="sendAddress" cols="" rows="2" datatype="*" errormsg="收货地址不正确!" class="textarea" placeholder="请填写详细地址,最多支持50字符" onKeyUp="$.Huitextarealength(this,50)">${customerCommon.relationSendAddress!''}</textarea>
                     <span id="addrssMsg"></span>
                 </div>
             </div>
@@ -369,9 +388,88 @@
                             </tr>
                         </thead>
                         <tbody id="addProduct">
-                            <tr id="showOrder">
-                                <td style="text-align: center;" colspan="3">请选择订单之后再选择产品</td>
+                        <#list productList as product>
+                            <tr>
+                                <td width="80">
+                                    <input type="hidden" value="${product.productId}"><span>${product.productName}</span>
+                                </td>
+                                <td style="padding: 0px;text-align: center;">
+                                    <table style="height: 100%;">
+                                        <tbody>
+                                            <#list product.colorList as color>
+                                                <tr>
+                                                    <td width="55" style="border-left: none;text-align: center;border-top: 1px solid #ddd;">
+                                                        品蓝
+                                                    </td>
+                                                    <td width="45" style="border-top: 1px solid #ddd; padding: 0px;width: 25px;">
+                                                        <input type="hidden" class="input-produce-id" value="${product.productId}">
+                                                        <input type="hidden" class="input-color-id" value="${color.colorId}">
+                                                        <input type="text" class="input-text input-color-number number-input" style="width: 100%;border: none;text-align: center;" value="${color.colorId}" placeholder="产品数量" id="color-1-1" name="" onkeyup="keyFun($(this),999)" onpaste="keyFun($(this),999)">
+                                                    </td>
+                                                </tr>
+                                            </#list>
+                                            <tr>
+                                                <td width="55" style="border-left: none;text-align: center;border-top: 1px solid #ddd;">
+                                                    品蓝
+                                                </td>
+                                                <td width="45" style="border-top: 1px solid #ddd; padding: 0px;width: 25px;">
+                                                    <input type="hidden" class="input-produce-id" value="1">
+                                                    <input type="hidden" class="input-color-id" value="1">
+                                                    <input type="text" class="input-text input-color-number number-input" style="width: 100%;border: none;text-align: center;" value="1" placeholder="产品数量" id="color-1-1" name="" onkeyup="keyFun($(this),999)" onpaste="keyFun($(this),999)">
+                                                </td>
+                                            </tr>
+                                            <tr>
+                                                <td width="55" style="border-left: none;text-align: center;border-top: 1px solid #ddd;">品黑</td>
+                                                <td width="45" style="border-top: 1px solid #ddd; padding: 0px;width: 25px;">
+                                                    <input type="hidden" class="input-produce-id" value="1">
+                                                    <input type="hidden" class="input-color-id" value="2">
+                                                    <input type="text" class="input-text input-color-number number-input" style="width: 100%;border: none;text-align: center;" value="" placeholder="产品数量" id="color-1-2" name="" onkeyup="keyFun($(this),999)" onpaste="keyFun($(this),999)">
+                                                </td>
+                                            </tr>
+                                            <tr>
+                                                <td width="55" style="border-left: none;text-align: center;border-top: 1px solid #ddd;">苹果绿</td>
+                                                <td width="45" style="border-top: 1px solid #ddd; padding: 0px;width: 25px;">
+                                                    <input type="hidden" class="input-produce-id" value="1">
+                                                    <input type="hidden" class="input-color-id" value="3">
+                                                    <input type="text" class="input-text input-color-number number-input" style="width: 100%;border: none;text-align: center;" value="" placeholder="产品数量" id="color-1-3" name="" onkeyup="keyFun($(this),999)" onpaste="keyFun($(this),999)">
+                                                </td>
+                                            </tr>
+                                            <tr>
+                                                <td width="55" style="border-left: none;text-align: center;border-top: 1px solid #ddd;">西瓜红</td>
+                                                <td width="45" style="border-top: 1px solid #ddd; padding: 0px;width: 25px;">
+                                                    <input type="hidden" class="input-produce-id" value="1">
+                                                    <input type="hidden" class="input-color-id" value="4">
+                                                    <input type="text" class="input-text input-color-number number-input" style="width: 100%;border: none;text-align: center;" value="" placeholder="产品数量" id="color-1-4" name="" onkeyup="keyFun($(this),999)" onpaste="keyFun($(this),999)">
+                                                </td>
+                                            </tr>
+                                        </tbody>
+                                    </table>
+                                </td>
+                                <td style="padding: 0px;text-align: center;">
+                                    <table style="height: 100%;">
+                                        <tbody>
+                                        <tr>
+                                            <td width="55" style="border-left: none;text-align: center; border-top: 1px solid #ddd;">内部配件1</td>
+                                            <td width="45" style="border-top: 1px solid #ddd;padding: 0px;width: 25px;">
+                                                <input type="hidden" class="input-produce-id" value="1">
+                                                <input type="hidden" class="input-fittings-id" value="1">
+                                                <input type="text" class="input-text input-fittings-number" style="width: 100%;border: none;text-align: center;" value="3" placeholder="配件数量" id="fittings-1-1" name="" onkeyup="keyFun($(this),999)" onpaste="keyFun($(this),999)">
+                                            </td>
+                                        </tr>
+                                        <tr>
+                                            <td width="55" style="border-left: none;text-align: center; border-top: 1px solid #ddd;">内部配件2</td>
+                                            <td width="45" style="border-top: 1px solid #ddd;padding: 0px;width: 25px;">
+                                                <input type="hidden" class="input-produce-id" value="1">
+                                                <input type="hidden" class="input-fittings-id" value="2">
+                                                <input type="text" class="input-text input-fittings-number" style="width: 100%;border: none;text-align: center;" value="" placeholder="配件数量" id="fittings-1-2" name="" onkeyup="keyFun($(this),999)" onpaste="keyFun($(this),999)">
+                                            </td>
+                                        </tr>
+                                        </tbody>
+                                    </table>
+                                </td>
                             </tr>
+                        </#list>
+
                         </tbody>
                     </table>
 
@@ -382,7 +480,9 @@
                 <label class="form-label col-1 col-sm-1">TDS收集:</label>
                 <div class="formControls col-2 col-sm-2" style="position: relative;">
                     <input type="hidden" name="arrcity_3word" id="arrcity_3word" value="" />
-                    <input style="width: 190px;" placeholder="" class="input-text my-search-input" placeholder="请输入城市名称搜索" type="text" name="arrcity" id="arrcity" />
+                   <#-- <#assign index_num = customerInfo.customerArea?index_of("-") />-->
+                        <#--${customerInfo.customerArea?substring(0,)!'0'}-->
+                    <input style="width: 190px;" placeholder="" class="input-text my-search-input" placeholder="请输入城市名称搜索" type="text" name="arrcity" id="arrcity" value="" />
                     <div id="suggest" class="ac_results"></div>
                 </div>
                 <div class="formControls col-2 col-sm-2">
@@ -394,10 +494,10 @@
                 </div>
                 <input type="hidden" name="customerArea" id="customerArea">
                 <div class="formControls col-2 col-sm-2">
-                    <input type="text" class="input-text" value="" placeholder="进水TDS数值,最大999" id="customerInTDS" name="customerInTDS" onkeyup="TDSLinkage($(this),999)" onpaste="TDSLinkage($(this),999)">
+                    <input type="text" class="input-text" value="${customerInfo.customerInTDS!'0'}" placeholder="进水TDS数值,最大999" id="customerInTDS" name="customerInTDS" onkeyup="TDSLinkage($(this),999)" onpaste="TDSLinkage($(this),999)">
                 </div>
                 <div class="formControls col-2 col-sm-2">
-                    <input type="text" class="input-text" value="" placeholder="出水TDS数值,最大999" id="customerOutTDS" name="customerOutTDS" onkeyup="TDSLinkage($(this),999)" onpaste="TDSLinkage($(this),999)">
+                    <input type="text" class="input-text" value="${customerInfo.customerOutTDS!'0'}" placeholder="出水TDS数值,最大999" id="customerOutTDS" name="customerOutTDS" onkeyup="TDSLinkage($(this),999)" onpaste="TDSLinkage($(this),999)">
                 </div>
             </div>
             <div class="row cl" id="TDScollectShow" style="display: none;">
@@ -452,44 +552,51 @@
                 <label class="form-label col-1 col-sm-1"><span class="c-red">*</span>回访信息:</label>
                 <div class="formControls col-10 col-sm-10 skin-minimal">
                     <div class="radio-box">
-                        <input type="radio" id="customer-visit-1" name="customerIsVisit" value="2" >
+                        <input type="radio" id="customer-visit-1" name="customerIsVisit" value="2" <#if customerInfo.customerIsVisit == '2' >checked</#if> >
                         <label for="customer-visit-1">需要回访</label>
                     </div>
                     <div class="radio-box">
-                        <input type="radio" id="customer-visit-2" name="customerIsVisit"  value="1" checked>
+                        <input type="radio" id="customer-visit-2" name="customerIsVisit"  value="1" <#if customerInfo.customerIsVisit == '1' >checked</#if> >
                         <label for="customer-visit-2">不需要回访</label>
                     </div>
                 </div>
             </div>
-            <div id="needToVisit" style="display: none;">
+            <div id="needToVisit" style="<#if customerInfo.customerIsVisit == '1' >display: none;</#if>">
+                <#if visit??>
+                    <#assign visitName = visit.visitName/>
+                    <#assign customerTel = visit.visitTel/>
+                    <#assign visitDate = visit.visitDate/>
+                    <#assign visitTimeSelect = visit.visitTimeSelect/>
+                    <#assign designatedAdminId = visit.designatedAdminId/>
+                </#if>
                 <div class="row cl">
                     <label class="form-label col-1 col-sm-1"><span class="c-red">*</span>被回访人:</label>
                     <div class="formControls col-2 col-sm-2">
-                        <input type="text" class="input-text" value="" placeholder="填写回访人姓名" id="" name="visitName"  datatype="s1-20" errormsg="回访人姓名格式不正确!" >
+                        <input type="text" class="input-text" value="${visitName!''}" placeholder="填写回访人姓名" id="" name="visitName"   datatype="/^[\u4e00-\u9fa5]{1,20}$/" errormsg="回访人姓名格式不正确!" >
                     </div>
                     <div class="formControls col-2 col-sm-2">
-                        <input type="text" class="input-text associated-phone" value="" placeholder="填写回访人手机号" id="" name="visitTel" datatype="m" errormsg="回访人手机号码格式不正确!">
+                        <input type="text" class="input-text associated-phone" value="${customerTel!''}" placeholder="填写回访人手机号" id="" name="visitTel" datatype="m" errormsg="回访人手机号码格式不正确!">
                     </div>
                 </div>
                 <div class="row cl">
                     <label class="form-label col-1 col-sm-1"><span class="c-red">*</span>回访日期:</label>
                     <div class="formControls col-2 col-sm-2">
-                        <input type="text" placeholder="请选择回访日期" id="datemin"  name="visitDate" datatype="*" class="input-text Wdate" onclick="WdatePicker({skin:'whyGreen',minDate:'%y-%M-%d'})"  readonly="readonly">
+                        <input type="text" placeholder="请选择回访日期" id="datemin"  name="visitDate" value="${(visitDate?string("yyyy-MM-dd"))!''}" datatype="*" class="input-text Wdate" onclick="WdatePicker({skin:'whyGreen',minDate:'%y-%M-%d'})"  readonly="readonly">
                     </div>
                 </div>
                 <div class="row cl">
                     <label class="form-label col-1 col-sm-1"><span class="c-red">*</span>回访时间:</label>
                     <div class="formControls col-10 col-sm-10 skin-minimal">
                         <div class="radio-box">
-                            <input type="radio" id="visit-time-1" name="visitTimeSelect" value="1" checked>
+                            <input type="radio" id="visit-time-1" name="visitTimeSelect" value="1" <#if visitTimeSelect?? && visitTimeSelect== 1 >checked</#if> >
                             <label for="visit-time-1">09:00-12:00</label>
                         </div>
                         <div class="radio-box">
-                            <input type="radio" id="visit-time-2" name="visitTimeSelect" value="2">
+                            <input type="radio" id="visit-time-2" name="visitTimeSelect" value="2" <#if visitTimeSelect?? && visitTimeSelect == 2 >checked</#if> >
                             <label for="visit-time-2">12:00-14:00</label>
                         </div>
                         <div class="radio-box">
-                            <input type="radio" id="visit-time-3" name="visitTimeSelect" value="3">
+                            <input type="radio" id="visit-time-3" name="visitTimeSelect" value="3" <#if visitTimeSelect?? && visitTimeSelect == 3 >checked</#if>  >
                             <label for="visit-time-3">14:00-18:00</label>
                         </div>
                     </div>
@@ -498,7 +605,9 @@
                     <label class="form-label col-1 col-sm-1"><span class="c-red">*</span>提醒人:</label>
                     <div class="formControls col-4 col-sm-4"> <span class="select-box">
                     <select class="select" id="visitAdminId" name="visitAdminId">
-
+                        <#list adminList as admin>
+                            <option value ="${admin.adminId!}" <#if designatedAdminId??><#if designatedAdminId == admin.adminId >selected="selected"</#if></#if>>${admin.adminName!}</option>
+                        </#list>
                     </select>
                     </span>
                     </div>
@@ -693,6 +802,7 @@
         elementPathEnabled : false  /*去掉元素路径*/
     });
 
+    //是否已经初始化过邮寄信息
     var isInitSendAddressSms = false;
 
     sendAddressSms.ready(function() {
@@ -723,21 +833,24 @@
         noReasonBack : [["退回产品","退回产品颜色","退回产品配件"],[]]
     }
 
+    /*是否是修改页面*/
+    var isUpdate = true;
+
     /*个人id*/
     var adminId = 0;
 
     /* 咨询类型  1:售前咨询  2:售后咨询  3:其他  */
-    var allCustomerInfoType;
+    var allCustomerInfoType = ${customerInfo.customerCounselType};
 
     /*全局标识当前状态  type : 1 :已解决  2:未解决  3:换新  4:维修  5:补发   6:退货  7:无理由退货*/
-    var allCustomerType = 1;
+    var allCustomerType = ${customerInfo.customerIsSolve};
     var allCustomerTypeName = ["已解决","未解决","换新","维修","补发","退货","无理由退货"];
 
     /*  寄回地址的id */
     var complaint_questionId = 5;
 
     /* 用于判断是否第一次初始化省市区-- 只在选择类型为售后时使用 */
-    var isInitAddress = 0;
+    var isInitAddress = ${customerInfo.customerIsSolve!''};
 
     /*初始化页面参数*/
     $(function () {
@@ -745,19 +858,23 @@
         //initCheck();
 
         /*初始化产品类型 --  客诉头部的产品类型单选 */
-        initProduceType();
+        //initProduceType();
 
         /*初始化问题分类*/
-        initComplaintTypeInfo();
+        //initComplaintTypeInfo();
 
         /*初始化客服*/
-        initSysAdmin();
+        ///initSysAdmin();
 
         /*初始化回访客服*/
-        initVisitSysAdmin();
+        //initVisitSysAdmin();
+
+        /*初始化问题描述*/
+        initQuestionDescribe();
 
         /*初始化选择处理结果 -- type : 1 :已解决  2:未解决  3:换新  4:维修  5:补发   6:退货  7:无理由退货 */
-        initProcessResult(3);
+        initProcessResult(allCustomerType);
+
 
         /*监听来源入口选择事件*/
         $("input[name='customerSourceType']").change(function (){
@@ -859,14 +976,43 @@
     /*用于初始化回访信息的展示*/
     function initVisitEvent(){
         $("input[name='customerIsVisit']").change(function (){
-            if($(this).val() == 2){
-                $("#needToVisit").css("display","block");
-            }else{
-                $("#needToVisit").css("display","none");
+            if(!isUpdate){
+                if($(this).val() == 2){
+                    $("#needToVisit").css("display","block");
+                }else{
+                    $("#needToVisit").css("display","none");
+                }
             }
         })
     }
 
+    /**
+     * 初始化问题描述
+     */
+    function initQuestionDescribe(){
+        $.ajax({
+            type: "POST",
+            data: {
+                customerId : "${customerInfo.customerId!''}"
+            },
+            url: "${path}/admin/customer/select_question_describe",
+            success: function(data){
+                if (data.returnCode == 200) {
+                    var questionDescribe = data.returnMsg.questionDescribe;
+                    $("#describeTitle").val(questionDescribe.describeTitle);
+                    describeContentText.addListener("ready", function () {
+                        describeContentText.setContent(questionDescribe.describeContent);
+                    });
+                    describeHandleDescText.addListener("ready", function () {
+                        describeHandleDescText.setContent(questionDescribe.describeHandleDesc);
+                    });
+                }
+            },
+            error: function(XmlHttpRequest, textStatus, errorThrown){
+            }
+        });
+    }
+
     /*关闭qa*/
     function closeQA(){
         $(".dalog-ask").hide(); //隐藏qa
@@ -894,12 +1040,14 @@
     * type 1:不需要回访  2:需要回访
     * */
     function visitByType(type){
-        if(1 == type){  //不需要回访
-            $("#customer-visit-2").iCheck('check');  //设置不需要回访
-            $("#needToVisit").css("display","none");
-        }else{
-            $("#customer-visit-1").iCheck('check');  //设置需要回访
-            $("#needToVisit").css("display","block");
+        if(!isUpdate){
+            if(1 == type){  //不需要回访
+                $("#customer-visit-2").iCheck('check');  //设置不需要回访
+                $("#needToVisit").css("display","none");
+            }else{
+                $("#customer-visit-1").iCheck('check');  //设置需要回访
+                $("#needToVisit").css("display","block");
+            }
         }
         initVisitEvent();
     }
@@ -1058,10 +1206,21 @@
             }
 
             /* 在选择售后类型是,直接初始化省市区,使用isInitAddress 变量来判断 */
-            if(isInitAddress == 0){
-                var proId = setPro(null,2);
-                var cityId = setCity(null,proId,2);
+            if(isInitAddress == 1 || isInitAddress == 2){
+//                var proId = setPro(null,2);
+//                var cityId = setCity(null,proId,2);
+//                setDistrict(null,cityId,2);
+//                isInitAddress = 1;
+            }else if(isInitAddress == 3 || isInitAddress == 4 ||  isInitAddress == 5 ||  isInitAddress == 6 ||  isInitAddress == 7){
+                setPro(null,2);  //创建省
+                var proId = ${customerCommon.provinceNumber};
+                $("#province option[value='"+ proId +"']").attr("selected","true"); //设置省
+                setCity(null,proId,2);
+                var cityId = ${customerCommon.cityNumber};
+                $("#city option[value='" + cityId + "']").attr("selected","true"); //设置市
                 setDistrict(null,cityId,2);
+                var disId = ${customerCommon.areaNumber};
+                $("#district option[value='" + disId + "']").attr("selected","true"); //设置地区
                 isInitAddress = 1;
             }
 

+ 2 - 0
watero-rst-web/src/main/webapp/WEB-INF/views/order/excel_to_order.ftl

@@ -102,6 +102,8 @@
                             <option value="29">小莉团购</option>
                             <option value="30">超级妈咪团</option>
                             <option value="31">艾德叔叔</option>
+                            <option value="32">钱儿频道</option>
+                            <option value="33">尹建莉</option>
                         </select>
                     </label>
                 </td>

+ 2 - 2
watero-rst-web/src/main/webapp/WEB-INF/views/pts/batch/add_batch.ftl

@@ -46,7 +46,7 @@
         <div class="row cl">
             <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>批次编号:</label>
             <div class="formControls col-xs-8 col-sm-9">
-				<input type="text" class="input-text" value="" id="batchNo" name="batchNo" placeholder="请输入1-20位的批次编号,支持字母、数字" datatype="/^[a-zA-Z0-9]{1,20}$/" errormsg="请输入1-20位的批次编号,支持字母、数字!">
+				<input type="text" class="input-text" value="" id="batchNo" name="batchNo" placeholder="请输入1-20位的批次编号,支持字母、数字" datatype="/^[a-zA-Z0-9-_]{1,20}$/" errormsg="请输入1-20位的批次编号,支持字母、数字!">
             </div>
         </div>
 
@@ -85,7 +85,7 @@
             <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>软件版本:</label>
             <div class="formControls col-xs-8 col-sm-9">
                 <span class="select-box">
-				    <select class="select" size="1" name="batchSoftwareVersionId" id="batchSoftwareVersionId"  datatype="*" errormsg="请选择软件版本">
+				    <select class="select" size="1" name="batchSoftwareVersionId" id="batchSoftwareVersionId"  >
 				    </select>
 				</span>
                 <span id="batchSoftwareVersionIdMsg" style="color: red;"></span>

+ 3 - 3
watero-rst-web/src/main/webapp/WEB-INF/views/pts/batch/update_batch.ftl

@@ -47,7 +47,7 @@
         <div class="row cl">
             <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>批次编号:</label>
             <div class="formControls col-xs-8 col-sm-9">
-				<input type="text" class="input-text" value="${ptsBatch.batchNo}" id="batchNo" name="batchNo" placeholder="请输入1-20位的批次编号,支持字母、数字" datatype="/^[a-zA-Z0-9]{1,20}$/" errormsg="请输入1-20位的批次编号,支持字母、数字!">
+				<input type="text" class="input-text" value="${ptsBatch.batchNo}" id="batchNo" name="batchNo" placeholder="请输入1-20位的批次编号,支持字母、数字" datatype="/^[a-zA-Z0-9-_]{1,20}$/" errormsg="请输入1-20位的批次编号,支持字母、数字!">
             </div>
         </div>
 
@@ -102,10 +102,10 @@
         </div>
 
        <div class="row cl">
-            <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>软件版本:</label>
+            <label class="form-label col-xs-4 col-sm-3">软件版本:</label>
             <div class="formControls col-xs-8 col-sm-9">
                 <span class="select-box">
-				    <select class="select" size="1" name="batchSoftwareVersionId" id="batchSoftwareVersionId"  datatype="*" errormsg="请选择软件版本">
+				    <select class="select" size="1" name="batchSoftwareVersionId" id="batchSoftwareVersionId" >
                     <#if ptsMachineVersionList?? &&  (ptsMachineVersionList?size > 0) >
                         <#list ptsMachineVersionList as ptsMachineVersion>
                             <option value="${ptsMachineVersion.machineVersionId}" <#if ptsBatch.batchSoftwareVersionId == ptsMachineVersion.machineVersionId >selected="selected" </#if>>${ptsMachineVersion.machineVersionName}(${ptsMachineVersion.machineVersionNo})</option>

+ 1 - 1
watero-rst-web/src/main/webapp/WEB-INF/views/pts/produce/produce_list.ftl

@@ -12,7 +12,7 @@
     <title>生产产品列表</title>
     <style>
         .chanpin-list{margin: 0;padding: 10px;list-style-type: none;}
-        .chanpin-list>li{display: table-cell;width: 230px;border-left: 1px solid rgba(0,0,0,.1);border-bottom: 1px solid rgba(0,0,0,.1);background-color: #fff;position: relative;border-right: 30px solid transparent;padding-bottom: 30px;}
+        .chanpin-list>li{display: table-cell;width: 230px;border-left: 1px solid rgba(0,0,0,.1);border-bottom: 1px solid rgba(0,0,0,.1);background-color: #fff;position: relative;border-right: 30px solid transparent;padding-bottom: 30px;float: left; height: 500px;    margin-bottom: 25px;}
         .chanpin-list>li:after{content: '';position: absolute;right: 0;width: 1px;height: 100%;background-color: #ccc;-webkit-transform:scaleX(.5);  top:0;}
         .chanpin-list>li .title{background-color: #32a3d8;text-align: center;color: #fff;padding: 12px 0;}
         .chanpin-list>li .title>span{padding:3px 3px 3px 28px;background: url(${path}/common/images/pts/jiqi-1.png) left center no-repeat;background-size:auto 80%;}

+ 3 - 2
watero-rst-web/src/main/webapp/WEB-INF/views/pts/produce/save_produce.ftl

@@ -59,7 +59,8 @@
                     </#if>
                     </select>
                 </div>
-                <div class="input-box"><span class="input-dic">产品型号</span><input class="my-input" style="width: 120px;" type="text" name="producePattern" id="producePattern" value="" placeholder="1-3位英文、数字组合" required  maxlength="3" minlength="1"/>-<input class="my-input" style="width: 120px;" type="text" name="produceModel" id="produceModel" value="" placeholder="1-3位英文、数字组合" required  maxlength="3" minlength="1"/>  </div>
+                <div class="input-box"><span class="input-dic">产品型号</span><input class="my-input" style="width: 120px;" type="text" name="producePattern" id="producePattern" value="" placeholder="1-15位英文、数字组合" required  maxlength="15" minlength="1"/>-
+                    <input class="my-input" style="width: 120px;" type="text" name="produceModel" id="produceModel" value="" placeholder="1-15位英文、数字组合" required  maxlength="15" minlength="1"/>  </div>
 
                 <div class="input-box"><span class="input-dic">产品类型</span>
                     <label><input type="radio" name="produceType" value="1" checked>净水机</label>
@@ -118,7 +119,7 @@
 
     var check_name = /^[a-zA-Z0-9\u4e00-\u9fa5,.!;,。!;:“”\\"\\ ]+$/;
     var cnen_name = /^[a-zA-Z0-9\u4e00-\u9fa5]+$/;
-    var en_name = /^[a-zA-Z0-9]+$/;
+    var en_name = /^[a-zA-Z0-9_-]+$/;
 
     $(function(){
         //var validator = $("#form-admin-addProduce").validate();

+ 3 - 3
watero-rst-web/src/main/webapp/WEB-INF/views/pts/produce/update_produce.ftl

@@ -61,8 +61,8 @@
                 </select>
             </div>
 
-            <div class="input-box"><span class="input-dic">产品型号</span><input class="my-input" style="width: 120px;" type="text" name="producePattern" id="producePattern" placeholder="1-3位英文、数字组合" value="${produce.producePattern!}" placeholder="" required  maxlength="3" minlength="1"/>-
-                <input class="my-input" style="width: 120px;" type="text" name="produceModel" id="produceModel" value="${produce.produceModel!}" placeholder="1-3位英文、数字组合" required  maxlength="3" minlength="1"/>  </div>
+            <div class="input-box"><span class="input-dic">产品型号</span><input class="my-input" style="width: 120px;" type="text" name="producePattern" id="producePattern" placeholder="1-15位英文、数字组合" value="${produce.producePattern!}" placeholder="" required  maxlength="15" minlength="1"/>-
+                <input class="my-input" style="width: 120px;" type="text" name="produceModel" id="produceModel" value="${produce.produceModel!}" placeholder="1-15位英文、数字组合" required  maxlength="15" minlength="1"/>  </div>
 
             <div class="input-box"><span class="input-dic">产品类型</span>
                 <label><input type="radio" name="produceType" value="1" <#if produce.produceType == 1>checked</#if>>净水机</label>
@@ -127,7 +127,7 @@
 
     var check_name = /^[a-zA-Z0-9\u4e00-\u9fa5,.!;,。!;:“”\\"\\ ]+$/;
     var cnen_name = /^[a-zA-Z0-9\u4e00-\u9fa5]+$/;
-    var en_name = /^[a-zA-Z0-9]+$/;
+    var en_name = /^[a-zA-Z0-9_-]+$/;
 
     var delProcessIds="",delNodeIds="";
     $(function(){