zhs %!s(int64=3) %!d(string=hai) anos
pai
achega
9ad3f9fe5a

+ 27 - 0
src/main/java/com/travel/controller/PersonalController.java

@@ -229,4 +229,31 @@ public class PersonalController {
         }
         return map;
     }
+
+    /**
+     * 账号密码登录
+     * @param user 参数
+     * @return 返回结果
+     */
+    @GetMapping("getUserPassLogin")
+    public Map<String, Object> getUserPassLogin(User user) {
+        Map<String, Object> map = new HashMap<>();
+        try {
+            int count = loginService.getUserPassLoginCount(user);
+            if(count > 0){
+                User user1 = loginService.getUserPassLogin(user);
+                map.put("data", user1);
+                map.put("msg", "200");
+            } else {
+                map.put("errMsg", "账号或密码不正确");
+                map.put("msg", "300");
+            }
+        } catch (Exception e){
+            e.printStackTrace();
+            map.put("msg", "500");
+        }
+        return map;
+    }
+
+
 }

+ 4 - 0
src/main/java/com/travel/mapper/LoginMapper.java

@@ -31,4 +31,8 @@ public interface LoginMapper {
     List<User> getInvalidUser();
 
     void updateKeyToLog(User user);
+
+    User getUserPassLogin(User user);
+
+    int getUserPassLoginCount(User user);
 }

+ 4 - 0
src/main/java/com/travel/model/PrivateOrder.java

@@ -111,4 +111,8 @@ public class PrivateOrder implements Serializable {
      * 订单状态
      */
     private String orderType;
+    /**
+     * 金额
+     */
+    private String priceAll;
 }

+ 4 - 0
src/main/java/com/travel/model/Supplier.java

@@ -75,4 +75,8 @@ public class Supplier implements Serializable {
      * 昵称
      */
     private String name;
+    /**
+     * 密码
+     */
+    private String pass;
 }

+ 4 - 0
src/main/java/com/travel/service/LoginService.java

@@ -29,4 +29,8 @@ public interface LoginService {
     List<User> getInvalidUser();
 
     void updateKeyToLog(User user);
+
+    User getUserPassLogin(User user);
+
+    int getUserPassLoginCount(User user);
 }

+ 11 - 0
src/main/java/com/travel/service/impl/LoginServiceImpl.java

@@ -3,6 +3,7 @@ package com.travel.service.impl;
 import com.travel.mapper.LoginMapper;
 import com.travel.model.User;
 import com.travel.service.LoginService;
+import com.travel.util.DesEncry;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
@@ -86,4 +87,14 @@ public class LoginServiceImpl implements LoginService {
     public void updateKeyToLog(User user) {
         loginMapper.updateKeyToLog(user);
     }
+
+    @Override
+    public User getUserPassLogin(User user) {
+        return loginMapper.getUserPassLogin(user);
+    }
+
+    @Override
+    public int getUserPassLoginCount(User user) {
+        return loginMapper.getUserPassLoginCount(user);
+    }
 }

+ 1 - 1
src/main/java/com/travel/util/DesEncry.java

@@ -41,7 +41,7 @@ public class DesEncry {
     /**
      *
      * @param password 密码
-     * @param key 加密字符串
+     * @param password 加密字符串
      * @return 返回结果
      */
     public final static String encrypt(String password) {

+ 8 - 0
src/main/resources/config/mapping/LoginMapper.xml

@@ -85,4 +85,12 @@
     <update id="updateKeyToLog" parameterType="User">
         update sys_users set code=#{code},name=#{name},headpir=#{headpir} where id=#{id}
     </update>
+    <!-- 查询用户信息 -->
+    <select id="getUserPassLogin" parameterType="User" resultType="User">
+        select * from sys_users where code=#{code} and pass =#{pass}
+    </select>
+    <!-- 查询密码是否正确 -->
+    <select id="getUserPassLoginCount" parameterType="User" resultType="int">
+        select count(*) from sys_users where code=#{code} and pass =#{pass}
+    </select>
 </mapper>

+ 5 - 3
src/main/resources/config/mapping/PrivateOrderMapper.xml

@@ -15,13 +15,14 @@
             *
         FROM
             ( SELECT *, ROW_NUMBER ( ) OVER ( ORDER BY ID ) AS RowId FROM bus_private_ordering ) AS b
+            LEFT JOIN bus_supplier_release c ON b.uuid = c.demand_uuid
         WHERE
             RowId BETWEEN #{page} AND #{limit}
             <if test="uuid != null and uuid != ''">
-                and uuid = #{uuid}
+                and b.uuid = #{uuid}
             </if>
             <if test="code != null and code != ''">
-                and code = #{code}
+                and b.code = #{code}
             </if>
     </select>
     <!-- 查询私人订制 -->
@@ -30,10 +31,11 @@
             *
         FROM
             ( SELECT *, ROW_NUMBER ( ) OVER ( ORDER BY ID ) AS RowId FROM bus_private_ordering ) AS b
+            LEFT JOIN bus_supplier_release c ON b.uuid = c.demand_uuid
         WHERE
             RowId BETWEEN #{page} AND #{limit}
             <if test="uuid != null and uuid != ''">
-                and uuid = #{uuid}
+                and b.uuid = #{uuid}
             </if>
     </select>
     <!-- 删除私人订制 -->