Browse Source

bug fixes

PLF 5 years ago
parent
commit
3a2bb504c7

+ 5 - 5
src/main/java/com/caimei/controller/user/LoginController.java

@@ -124,12 +124,12 @@ public class LoginController {
         if (operationUser.getStatus().equals("2") && operationUser.getDelFlag().equals("0")) {
         if (operationUser.getStatus().equals("2") && operationUser.getDelFlag().equals("0")) {
             return res.error("-3", mobile);
             return res.error("-3", mobile);
         }
         }
-        if (!operationUser.getDelFlag().equals("0")) {
-            return res.error("-1", "您的账号已下线");
-        }
         if (operationUser.getClubStatus().equals("91")) {
         if (operationUser.getClubStatus().equals("91")) {
             return res.error("-1", "您所在的会所已下线");
             return res.error("-1", "您所在的会所已下线");
         }
         }
+        if (!operationUser.getDelFlag().equals("0")) {
+            return res.error("-1", "您的账号已下线");
+        }
         return res.error("1", "邀请码通过");
         return res.error("1", "邀请码通过");
     }
     }
 
 
@@ -178,7 +178,7 @@ public class LoginController {
             return res;
             return res;
         }
         }
         operationUser.setOpenid(openid);
         operationUser.setOpenid(openid);
-        loginService.update(operationUser);
-        return res.success("1", operationUser);
+        WxJsonModel jsonModel = loginService.update(operationUser);
+        return jsonModel;
     }
     }
 }
 }

+ 1 - 1
src/main/java/com/caimei/mapper/user/PersonalMapper.java

@@ -30,5 +30,5 @@ public interface PersonalMapper {
 
 
     Address findDefaultAddress(Integer userID);
     Address findDefaultAddress(Integer userID);
 
 
-    Integer ableUserMoney(Integer userId);
+    Double ableUserMoney(Integer userId);
 }
 }

+ 2 - 1
src/main/java/com/caimei/service/user/LoginService.java

@@ -1,6 +1,7 @@
 package com.caimei.service.user;
 package com.caimei.service.user;
 
 
 import com.caimei.entity.CmOperationUser;
 import com.caimei.entity.CmOperationUser;
+import com.caimei.entity.WxJsonModel;
 
 
 public interface LoginService {
 public interface LoginService {
 
 
@@ -8,7 +9,7 @@ public interface LoginService {
 
 
     CmOperationUser isEnabled(String invitationCode, Integer userOrganizeID);
     CmOperationUser isEnabled(String invitationCode, Integer userOrganizeID);
 
 
-    void update(CmOperationUser operationUser);
+    WxJsonModel update(CmOperationUser operationUser);
 
 
     String cellPhone(Integer userOrganizeID);
     String cellPhone(Integer userOrganizeID);
 }
 }

+ 9 - 1
src/main/java/com/caimei/service/user/impl/LoginServiceImpl.java

@@ -1,6 +1,7 @@
 package com.caimei.service.user.impl;
 package com.caimei.service.user.impl;
 
 
 import com.caimei.entity.CmOperationUser;
 import com.caimei.entity.CmOperationUser;
+import com.caimei.entity.WxJsonModel;
 import com.caimei.mapper.user.LoginMapper;
 import com.caimei.mapper.user.LoginMapper;
 import com.caimei.service.user.LoginService;
 import com.caimei.service.user.LoginService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -26,7 +27,13 @@ public class LoginServiceImpl implements LoginService {
     }
     }
 
 
     @Override
     @Override
-    public void update(CmOperationUser operationUser) {
+    public WxJsonModel update(CmOperationUser operationUser) {
+        WxJsonModel res = WxJsonModel.newInstance();
+        CmOperationUser cmOperationUser = loginMapper.doLogin(operationUser.getOpenid(), operationUser.getUserOrganizeID());
+        //判断是否已有绑定用户
+        if (cmOperationUser != null) {
+            return res.error("您已授权,无需重复登录~");
+        }
         CmOperationUser user = loginMapper.query(operationUser);
         CmOperationUser user = loginMapper.query(operationUser);
         //判断是否存在已下线的会所用户
         //判断是否存在已下线的会所用户
         if (user != null) {
         if (user != null) {
@@ -42,6 +49,7 @@ public class LoginServiceImpl implements LoginService {
         operationUser.setBindTime(new Date());
         operationUser.setBindTime(new Date());
         operationUser.setUpdateTime(new Date());
         operationUser.setUpdateTime(new Date());
         loginMapper.update(operationUser);
         loginMapper.update(operationUser);
+        return res.success(operationUser);
     }
     }
 
 
     @Override
     @Override

+ 2 - 2
src/main/java/com/caimei/service/user/impl/PersonalServiceImpl.java

@@ -40,8 +40,8 @@ public class PersonalServiceImpl implements PersonalService {
         PageHelper.startPage(index, pageSize);
         PageHelper.startPage(index, pageSize);
         List<CmUserBalanceRecord> list = personalMapper.touchBalance(balanceRecord);
         List<CmUserBalanceRecord> list = personalMapper.touchBalance(balanceRecord);
         Page<CmUserBalanceRecord> page = new Page<>(list);
         Page<CmUserBalanceRecord> page = new Page<>(list);
-        Integer ableUserMoney = personalMapper.ableUserMoney(balanceRecord.getUserId());
-        if (ableUserMoney == null) ableUserMoney = 0;
+        Double ableUserMoney = personalMapper.ableUserMoney(balanceRecord.getUserId());
+        if (ableUserMoney == null) ableUserMoney = 0d;
         Map<String, Object> map = new HashMap();
         Map<String, Object> map = new HashMap();
         map.put("page", page);
         map.put("page", page);
         map.put("ableUserMoney", ableUserMoney);
         map.put("ableUserMoney", ableUserMoney);

+ 1 - 1
src/main/resources/mapper/PersonalMapper.xml

@@ -40,7 +40,7 @@
         ORDER BY cubr.addDate DESC
         ORDER BY cubr.addDate DESC
     </select>
     </select>
 
 
-    <select id="ableUserMoney" resultType="int">
+    <select id="ableUserMoney" resultType="Double">
         SELECT ableUserMoney FROM USER WHERE userID = #{userID}
         SELECT ableUserMoney FROM USER WHERE userID = #{userID}
     </select>
     </select>