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

未选中二级部门报错

caotao 5 éve
szülő
commit
0c55f9b925

+ 1 - 1
admin-ui/app/whepi/index.html

@@ -6,7 +6,7 @@
     <meta http-equiv="X-UA-Compatible" content="IE=edge, chrome=1">
     <meta name="renderer" content="webkit">
     <link rel="shortcut icon" href="/static/logo.png"/>
-    <title>家园公众号</title>
+    <title>凌云家园平台</title>
     <link type="text/css" rel="stylesheet" href="/static/css/themes/default/easyui.css"/>
     <link type="text/css" rel="stylesheet" href="/static/plugins/jquery-ui-1.12.1.custom/jquery-ui.min.css"/>
     <link type="text/css" rel="stylesheet" href="/static/plugins/jqgrid_4.15.6/css/ui.jqgrid.min.css"/>

+ 139 - 0
whepi-ui/templates/user/register.ftl

@@ -0,0 +1,139 @@
+<#assign title="用户注册"/>
+<#include "/home/frag.head.ftl" />
+
+<div class="weui-tab">
+    <div class="weui-tab__bd">
+
+        <div id="first" >
+            <div class="weui-tab__bd-item weui-tab__bd-item--active">
+                <div class="page__bd">
+                    <header class="user-header">
+                        <br/>
+                        <h1 class="user-title">凌云集团</h1>
+                        <br/>
+                    </header>
+                    <br/>
+                    <br/>
+                    <div>
+                        <div class="weui-cells__title" >姓名</div>
+                        <div class="weui-cells">
+                            <div class="weui-cell">
+                                <div class="weui-cell__bd">
+                                    <input class="weui-input" type="text" id="linkman" placeholder="请填写真实姓名"/>
+                                </div>
+                            </div>
+                        </div>
+                    </div>
+
+
+                    <div id="phoneMsg" >
+                        <div class="weui-cells__title" id="phoneTitle">手机号</div>
+                        <div class="weui-cells">
+                            <div class="weui-cell">
+                                <div class="weui-cell__bd">
+                                    <input class="weui-input" type="text" id="phone" placeholder="请输入手机号"/>
+                                </div>
+                            </div>
+                        </div>
+                    </div>
+
+
+                    <div id="yaoqingmaSS" style="display: none">
+                        <div class="weui-cells__title">邀请码</div>
+                        <div class="weui-cells">
+                            <div class="weui-cell">
+                                <div class="weui-cell__bd">
+                                    <input class="weui-input" type="text" id="yaoqingma" placeholder="请输入邀请码"/>
+                                </div>
+                            </div>
+                        </div>
+                    </div>
+
+
+                    <br/>
+                    <br/>
+                    <br/>
+                    <br/>
+                    <div class="weui-form__opr-area">
+                        <a class="weui-btn weui-btn_primary" href="javascript:;" onclick="save();" id="save">确定</a>
+                    </div>
+
+                </div>
+            </div>
+        </div>
+
+    </div>
+</div>
+</div>
+</body>
+<#include "/home/frag.foot.ftl" />
+<script>
+
+    $(document).ready(function () {
+
+    })
+
+    <#if user_id ??>var userId = ${user_id!''}</#if>;
+
+    function save() {
+
+
+        var linkman = $("#linkman").val();
+        if (!linkman) {
+            $.alert("请填写姓名!")
+            return false;
+        }
+
+        var phone = $("#phone").val();
+        if (!phone) {
+            $.alert("请填写手机号!")
+            return false;
+        }
+
+
+        // var yaoqingma = $("#yaoqingma").val();
+        // if (yaoqingma != '5714') {
+        //     $.alert("请填写正确的邀请码!")
+        //     return false;
+        // }
+
+
+        $.ajax({
+            url: '/home/checkPhone.json',
+            type: "post",
+            data: {
+                "phone": phone,
+            }, success: function (data) {
+                if (!data.success) {
+                    $.alert(data.msg);
+                    return false;
+                } else {
+                    $.ajax({
+                        url: '/home/saveUser.json',
+                        type: "post",
+                        data: {
+                            "userId": userId,
+                            "linkman": $("#linkman").val(),
+                            "phone": $("#phone").val(),
+                            "city": null,
+                            "area": null,
+                            "unitId": 1000,
+                            "uptownId": null,
+                            "doorplate": null,
+                        }, success: function (date) {
+                            window.location.href = "/user/register.html?userId=" + userId + "&userType=1";
+                        }
+                    });
+                }
+            }
+        });
+    }
+
+
+</script>
+
+
+
+
+
+

+ 17 - 0
whepi-web/src/main/java/com/bofeng/service/UserOpenService.java

@@ -9,7 +9,9 @@ import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Propagation;
 import org.springframework.transaction.annotation.Transactional;
 
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 
 @Service
 @Transactional(readOnly = true)
@@ -105,6 +107,21 @@ public class UserOpenService {
             userOpenOld.setOpenId(userOpenNew.getOpenId());
             userOpenMapper.updateByUserId(userOpenOld);
             userOpenMapper.deleteByUserId(userId);
+
+
+            String openId = userOpenOld.getOpenId();
+            Map<String, Object> columnMap = new HashMap<>();
+            columnMap.put("open_id",openId);
+            List<UserOpen> userOpenList = userOpenMapper.selectByMap(columnMap);
+            if(userOpenList!=null&userOpenList.size()>1){
+                for(int i= 0;i<userOpenList.size();i++){
+                    UserOpen userOpen = userOpenList.get(i);
+                    if(userOpen.getUserId() != oldUserId){
+                        userOpenMapper.deleteByUserId(userOpen.getUserId());
+                    }
+                }
+            }
+
             resultModel.put("newUserId",oldUserId);
             resultModel.put("success", true);
         }else{