瀏覽代碼

修改了后台代理商页面

liuzhiwei 7 年之前
父節點
當前提交
cb60b987d6

+ 8 - 1
tooth-common-tool/src/main/java/com/iamberry/wechat/tools/ResultInfo.java

@@ -145,6 +145,11 @@ public class ResultInfo {
 	 * 	付费代理商支付后推送推荐人通知  	模版id	
 	 */
 	public static String prize_receive_push="";
+
+	/**
+	 * 更换刷头提示信息 模板id
+	 */
+	public static String update_tooth_hint="";
 	/**
 	 * 返现到账通知消息模版
 	 */
@@ -176,7 +181,9 @@ public class ResultInfo {
 	
 	/** 	奖品领取通知 	*/
 	public static String PRIZERECEIVEPUSH = "{'first':{'color':'#173177','value':'firstValueIamberry'}, 'keyword1':{'color':'#173177','value':'keyword1Value'}, 'keyword2':{'color':'#173177', 'value':'keyword2Value'},'keyword3':{'color':'#173177','value':'keyword3Value'},'keyword4':{'color':'#173177','value':'keyword4Value'},'keyword5':{'color':'#173177','value':'keyword5Value'},'remark':{'color':'#FF0000','value':'remarkValue'}}";
-	
+
+	/**  更换刷头提示信息  */
+	public static String UPDATETOOTHHINT= "{'first':{'color':'#173177','value':'firstValueIamberry'}, 'keyword1':{'color':'#173177','value':'keyword1Value'}, 'keyword2':{'color':'#173177', 'value':'keyword2Value'},'remark':{'color':'#173177','value':'remarkValue'}}";
 	/**
 	 * 微信模板消息提示语
 	 */

+ 1 - 1
tooth-wechat-web/src/main/java/com/iamberry/wechat/handles/admin/AdminAgentToothHandler.java

@@ -367,7 +367,7 @@ public class AdminAgentToothHandler {
         config2.setColorId(agentConfig.getColorId());
         //根据代理商id和产品颜色id查询配置信息
         config2 = agentInfoService.getAgentConfig(config);
-        if (config2 != null) {
+        if (config2 != null && config2.getConfigId().intValue() != config.getConfigId()) {
             msg.setResultCode(ResultInfo.ERRORCODE);
             msg.setStatus(false);
             msg.setMessage("该代理商已配置过该产品的优惠价,不能重复配置!");

+ 2 - 0
tooth-wechat-web/src/main/java/com/iamberry/wechat/handles/mq/MQTask.java

@@ -401,6 +401,8 @@ public class MQTask implements InitializingBean {
 			hint.setHintId(order.getHintId());
 			hint.setHintNum(1);
 			list.add(hint);
+			//更换牙刷刷头提示
+			sendMessageUtil.probationApplyNotice("上朵电动牙刷商城", "上朵电动牙刷","您的牙刷已使用三个月,请及时更换刷头!", "上朵电动牙刷商城", order.getUserOpenId(),null);
 		}
 		//批量修改更换刷头信息
 		int num = agentPurchaseOrderService.updateOrderHintList(list);

+ 21 - 0
tooth-wechat-web/src/main/java/com/iamberry/wechat/utils/SendMessageUtil.java

@@ -74,6 +74,9 @@ public class SendMessageUtil {
 			case 10:  //10、奖品领取通知 
 				WeixinUtil.sendTemplateMessage(NameUtils.getConfig("appId"), NameUtils.getConfig("appSecret"), openId, ResultInfo.prize_receive_push, date, url);
 				break;
+			case 11:
+				WeixinUtil.sendTemplateMessage(NameUtils.getConfig("appId"), NameUtils.getConfig("appSecret"), openId, ResultInfo.update_tooth_hint, date, url);
+				break;
 			default: 
 				break;
 			}
@@ -213,4 +216,22 @@ public class SendMessageUtil {
 					.replaceFirst("remarkValue",remark);
 				sendTemplateMessageToOpenid(temp, openId, url,10);
 		}
+
+	/**
+	 * 更换牙刷刷头提示信息
+	 * @param first
+	 * @param keyword1
+	 * @param keyword2
+	 * @param remark
+	 * @param openId
+	 * @param url
+	 */
+	public void updateToothHint(String first,String keyword1,String keyword2,String remark,String openId,String url){
+		String temp = ResultInfo.UPDATETOOTHHINT;
+		temp = temp.replaceFirst("firstValueIamberry", first)
+				.replaceFirst("keyword1Value",keyword1)
+				.replaceFirst("keyword2Value",keyword2)
+				.replaceFirst("remarkValue",remark);
+		sendTemplateMessageToOpenid(temp, openId, url,11);
+	}
 }

+ 1 - 0
tooth-wechat-web/src/main/resources/ResultInfo.properties

@@ -67,4 +67,5 @@ probation_apply_success=izMBTEvvMbzWY6YWyxG5RVP4j2-g5BJUe2MIXLH6mz8
 probation_pay_success=SrPdazrlMtsScC5w06C0ktqY-VnpLRCIqTeVtvtwxks
 probation_shut_down=QzfF4V8M9xXHR24kLsDABKNWGBGRVDVT0CSLQ_X3mpg
 prize_receive_push=7d_r3XJsY5MAISYCDxrjdnPXgNm3IU8XLRYWXbCJjbs
+update_tooth_hint=Ca7Yj8rbRPF6cnL5ZU3-gN9Bu2v98Jj_g2R0yw8NuAs
 

+ 1 - 1
tooth-wechat-web/src/main/webapp/WEB-INF/views/admin/agentInfo/addAgentInfo.jsp

@@ -125,7 +125,7 @@
                     });
 
                 } else {
-                    layer.msg("添加失败</br>",{icon: 5,time:2000});
+                    layer.msg(data.message+"</br>",{icon: 5,time:2000});
                 }
             }
         });

+ 2 - 2
tooth-wechat-web/src/main/webapp/WEB-INF/views/admin/agentInfo/agentConfigList.jsp

@@ -83,7 +83,7 @@
                 <td>${config.productName }</td>
                 <td>${config.colorName }</td>
                 <td>${config.configAmount==null?"":config.configAmount/100 }</td>
-                <td id="config_status">${config.configStatus==1?'启用':''}${config.configStatus==2?'停用':''}</td>
+                <td id="config_status${config.configId }">${config.configStatus==1?'启用':''}${config.configStatus==2?'停用':''}</td>
                 <td><fmt:formatDate value="${config.configCreateTime }" pattern="yyyy-MM-dd HH:mm:ss"/></td>
                 <td class="td-manage">
                     <input id="configStatus" type="hidden" value="${config.configStatus }">
@@ -136,7 +136,7 @@
                                     message = '停用';
                                     break;
                             }
-                            $('#config_status').html(message);
+                            $('#config_status'+id).html(message);
                         } else {
                             layer.alert(data.message, {icon: 5});
                         }

+ 26 - 31
tooth-wechat-web/src/main/webapp/WEB-INF/views/admin/agentInfo/agentInfoList.jsp

@@ -46,9 +46,9 @@
             <div class="text-c">
                 <button type="button" style="float:left;" class="btn btn-success radius" onclick="add_Agent();" id="addAgent" name=""><i class="Hui-iconfont">&#xe665;</i> 添加代理商</button>
                 <select name="agentStatus" style="height: 30px;">
-                    <option value="">线下状态</option>
-                    <option <c:if test="${agentStatus == 1}">selected = "selected"</c:if> value="1">正在使用</option>
-                    <option <c:if test="${agentStatus == 2}">selected = "selected"</c:if> value="2">停止使用</option>
+                    <option value="">状态</option>
+                    <option <c:if test="${agentStatus == 1}">selected = "selected"</c:if> value="1">用</option>
+                    <option <c:if test="${agentStatus == 2}">selected = "selected"</c:if> value="2">停用</option>
                   </select>
                 <input type="text" class="input-text" style="width:130px" placeholder="请输入代理商姓名" value="${agentName}" name="agentName">
                 <input type="text" class="input-text" style="width:130px" placeholder="请输入代理商电话" value="${agentTel}" name="agentTel">
@@ -66,7 +66,7 @@
                 <th width="100">名称</th>
                 <th width="100">地址</th>
                 <th width="100">电话</th>
-                <th width="100">线下状态</th>
+                <th width="100">状态</th>
                 <th width="100">创建时间</th>
                 <th width="100">操作</th>
             </tr>
@@ -78,30 +78,24 @@
                 <td>${list.agentName }</td>
                 <td>${list.agentAddr }</td>
                 <td>${fn:substring(list.agentTel,0,3)}****${fn:substring(list.agentTel,7,11)}</td>
-                <td>
+                <td id="agent_status${list.agentId }">
                     <c:if test="${list.agentStatus == 1}">
-                        正在使
+                        
                     </c:if>
                     <c:if test="${list.agentStatus == 2}">
-                        停止使
+                        停用
                     </c:if>
                 </td>
                 <td><fmt:formatDate value="${list.agentCreateDate }" pattern="yyyy-MM-dd HH:mm:ss"/></td>
                 <td class="td-manage">
-                    <div id="config_status">
-                        <c:if test="${list.agentStatus == 2}">
-                            <a onclick="updateagentState('${list.agentId }','1')"
-                               title="修改状态" href="javascript:;"  class="ml-5" style="text-decoration:none">修改为正在使用</a>
-                        </c:if>
-                        <c:if test="${list.agentStatus == 1}">
-                            <a onclick="updateagentState('${list.agentId }','2')"
-                                                                 title="修改状态" href="javascript:;"  class="ml-5" style="text-decoration:none">修改为停用</a>
-            </c:if>
-        </div>
-
-        <a onclick="updateAgent('${list.agentId}')"
-           title="修改" href="javascript:;"  class="ml-5" style="text-decoration:none">修改代理商信息</a>
-        </td>
+                    <input id="agentStatus" type="hidden" value="${list.agentStatus }">
+                    <select id="goodstatus" name="" onchange="updateGiftState(this,${list.agentId },${list.agentTel})">
+                        <option value="1" ${list.agentStatus==1?'selected':''}>启用</option>
+                        <option value="2" ${list.agentStatus==2?'selected':''}>停用</option>
+                    </select>
+                    <a onclick="updateAgent('${list.agentId}')"
+                       title="编辑" href="javascript:;"  class="ml-5" style="text-decoration:none"><i class="Hui-iconfont">&#xe6df;</i></a>
+                </td>
         </c:forEach>
         </c:if>
         </tbody>
@@ -121,32 +115,33 @@
 <script type="text/javascript" src="${pageContext.request.contextPath }/common/js/page/jqPaginator.js"></script>
 <script type="text/javascript" src="${pageContext.request.contextPath }/common/goods/js/utils.js"></script>
 <script type="text/javascript">
-    function updateagentState(id,state){
+
+    function updateGiftState(_this,id,tel){
+        var obj = $(_this);
         layer.confirm('确认要修改状态吗?',function(index){
                 $.ajax({
                     url: '${pageContext.request.contextPath }/admin/agentTooth/update_agentInfo',
                     type: "POST",
                     dataType: "json",
-                    data: {agentId : id,agentStatus : state},
+                    data: {agentId : id,agentStatus : obj.val(),agentTel:tel},
                     error:function(data){
                         layer.msg("修改失败</br>",{icon: 5,time:2000});
                     },
                     success:  function(data){
                         if (data.status) {
                             layer.msg("修改成功</br>",{icon: 1,time:2000});
-                            location.replace(location.href);
-                            /*var message = '';
-                            switch (state) {
+                            var message = '';
+                            switch (obj.val()) {
                                 case "1":
-                                    message = '<a onclick="updateagentState('+id+',2)" title="修改状态" href="javascript:;"  class="ml-5" style="text-decoration:none">修改为停止使用</a>';
+                                    message = '启用';
                                     break;
                                 case "2":
-                                    message = '<a onclick="updateagentState('+id+',1)" title="修改状态" href="javascript:;"  class="ml-5" style="text-decoration:none">修改为正在使用</a>';
+                                    message = '停用';
                                     break;
-                            }*/
-                           /* $('#config_status').html(message);*/
+                            }
+                            $('#agent_status'+id).html(message);
                         } else {
-                            layer.msg("修改失败</br>",{icon: 5,time:2000});
+                            layer.alert(data.message, {icon: 5});
                         }
                     }
                 });

+ 6 - 2
tooth-wechat-web/src/main/webapp/WEB-INF/views/admin/agentInfo/agentOrderList.jsp

@@ -63,7 +63,7 @@
         </div>
     </form>
     <span class="layui-layer-setwin">
-			<a class="layui-layer-ico layui-layer-close layui-layer-close1" onclick="exitWindowsDiv(this)" href="javascript:;"></a>
+			<a class="layui-layer-ico layui-layer-close layui-layer-close1" onclick="close_address()" href="javascript:;"></a>
 		</span>
 </div>
 <!-- 同步订单状态 -->
@@ -88,7 +88,7 @@
         </div>
     </form>
     <span class="layui-layer-setwin">
-				<a class="layui-layer-ico layui-layer-close layui-layer-close1" onclick="exitWindowsDiv(this)" href="javascript:;"></a>
+				<a class="layui-layer-ico layui-layer-close layui-layer-close1" onclick="close_synOrder()" href="javascript:;"></a>
 		</span>
 </div>
 <nav class="breadcrumb">
@@ -301,6 +301,10 @@
             }
         });
     }
+
+    function close_synOrder() {
+        $('#layui-SynOrder').hide();
+    }
 </script>
 </body>
 </html>