瀏覽代碼

Merge branch 'develop' of http://132.232.206.88:3000/lift-manager/lift-server into develop

黄远 5 年之前
父節點
當前提交
974df14bfd

+ 2 - 1
.gitignore

@@ -52,7 +52,8 @@ yarn-error.log*
 */.settings
 */.project
 */.classpath
-/.factorypath
+/.factory-path
+*.log
 package-lock.json
 */node_modules/
 */dist/

+ 4 - 4
lift-portal-service/pom.xml

@@ -18,10 +18,10 @@
         </dependency>
 
         <!--单体开发时注释掉依赖-->
-        <dependency>
-            <groupId>cn.com.xwy</groupId>
-            <artifactId>xwy-cloud-dependencies</artifactId>
-        </dependency>
+<!--        <dependency>-->
+<!--            <groupId>cn.com.xwy</groupId>-->
+<!--            <artifactId>xwy-cloud-dependencies</artifactId>-->
+<!--        </dependency>-->
 
     </dependencies>
 

+ 3 - 3
lift-portal-service/src/main/resources/application.yml

@@ -7,9 +7,9 @@ spring:
   profiles:
     active: dev
   datasource:
-    url: jdbc:mysql://127.0.0.1:3306/portal?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true&serverTimezone=UTC
-    username: mysql
-    password: mysql
+    url: jdbc:mysql://132.232.206.88/rdsliftmanager?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true&serverTimezone=UTC
+    username: root
+    password: ms.c88pocY/
 
 #自动添加createTime、isDelete 等字段
 xwy:

+ 2 - 2
lift-portal-service/src/main/resources/mapper/RoleMenuMapper.xml

@@ -1,9 +1,9 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="cn.com.ty.cn.com.ty.portal.dao.mapper.RoleMenuMapper">
+<mapper namespace="cn.com.ty.portal.dao.mapper.RoleMenuMapper">
 
 
-    <select id="queryMenuByRole" resultType="cn.com.ty.cn.com.ty.portal.service.model.RoleMenuModel">
+    <select id="queryMenuByRole" resultType="cn.com.ty.portal.service.model.RoleMenuModel">
         SELECT
             sr.role_code roleCode,
             sr.role_name roleName,

+ 2 - 2
lift-system-service/pom.xml

@@ -18,10 +18,10 @@
             <artifactId>xwy-spring-boot</artifactId>
         </dependency>
 
-        <!--<dependency>
+        <dependency>
             <groupId>cn.com.xwy</groupId>
             <artifactId>xwy-cloud-dependencies</artifactId>
-        </dependency>-->
+        </dependency>
 
     </dependencies>
 

+ 1 - 1
lift-system-service/src/main/java/cn/com/ty/lift/system/SystemApplication.java

@@ -12,7 +12,7 @@ import org.springframework.cloud.openfeign.EnableFeignClients;
  */
 @Slf4j
 @EnableFeignClients
-@MapperScan("cn.com.ty.**.dao.mapper")
+@MapperScan("cn.com.ty.**.mapper")
 @SpringBootApplication(scanBasePackages = {"cn.com.ty.lift", "cn.com.xwy.boot"})
 public class SystemApplication {
 

+ 22 - 0
lift-system-service/src/main/java/cn/com/ty/lift/system/entity/User.java

@@ -0,0 +1,22 @@
+package cn.com.ty.lift.system.entity;
+
+import lombok.Data;
+
+/**
+ * @ClassName User
+ * @Description
+ * @Author huangyuan
+ * @Date 2019-11-26 15:54
+ **/
+@Data
+public class User {
+
+    private Long id;
+
+    private String name;
+
+    private String account;
+
+    private String password;
+
+}

+ 45 - 0
lift-system-service/src/main/java/cn/com/ty/lift/system/entity/UserInfo.java

@@ -0,0 +1,45 @@
+package cn.com.ty.lift.system.entity;
+
+import lombok.Data;
+
+import java.math.BigDecimal;
+
+/**
+ * 实体类 - 表:user_info
+ * @since 2019-11-25 18:01:00
+ */
+@Data
+public class UserInfo {
+	private Long userId;
+
+	private String name;
+
+	private String mobile;
+
+	private Byte gender;
+
+	private Byte age;
+
+	private String remarks;
+
+	private String signature;
+
+	private Integer serviceTotal;
+
+	private Integer satisfactionTotal;
+
+	private Integer level;
+
+	private Integer maintenanceTotal;
+
+	private Integer emergencyTotal;
+
+	private Integer liftTotal;
+
+	private BigDecimal balance;
+
+	private String type;
+
+	private String avatarUrl;
+
+}

+ 25 - 0
lift-system-service/src/main/java/cn/com/ty/lift/system/mapper/UserInfoMapper.java

@@ -0,0 +1,25 @@
+package cn.com.ty.lift.system.mapper;
+
+import cn.com.ty.lift.system.entity.UserInfo;
+import cn.com.xwy.boot.mybatis.MyBatisMapper;
+
+/**
+ * MyBatis Mapper 接口 - 表:user_info
+ * @since 2019-11-25 18:01:00
+ */
+@MyBatisMapper
+public interface UserInfoMapper {
+	int deleteByPrimaryKey(Long userId);
+
+	int insert(UserInfo record);
+
+	int insertSelective(UserInfo record);
+
+	UserInfo selectByPrimaryKey(Long userId);
+
+	int updateByPrimaryKeySelective(UserInfo record);
+
+	int updateByPrimaryKeyWithBLOBs(UserInfo record);
+
+	int updateByPrimaryKey(UserInfo record);
+}

+ 31 - 0
lift-system-service/src/main/java/cn/com/ty/lift/system/user/controller/UserController.java

@@ -1,9 +1,40 @@
 package cn.com.ty.lift.system.user.controller;
 
+import cn.com.ty.lift.system.entity.User;
+import cn.com.ty.lift.system.entity.UserInfo;
+import cn.com.ty.lift.system.user.service.impl.UserService;
+import cn.com.xwy.boot.web.dto.RestResponse;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.ResponseBody;
 import org.springframework.web.bind.annotation.RestController;
+
 @RestController
 @RequestMapping("/user")
 public class UserController {
 
+    @Autowired
+    private UserService userService;
+
+    @RequestMapping("/login")
+    @ResponseBody
+    public User getUser(String userId){
+        User user = userService.getUserById(userId);
+        return user;
+    }
+
+    /**
+     * @description
+     * @date 2019/11/27 10:03 AM
+     * @param
+     * @return
+     */
+    @PostMapping("/addUser")
+    @ResponseBody
+    public Object addUserInfo(UserInfo userInfo){
+        userService.saveUserInfo(userInfo);
+        return RestResponse.ok(UserInfo.class, "success");
+    }
+
 }

+ 13 - 1
lift-system-service/src/main/java/cn/com/ty/lift/system/user/service/IUserService.java

@@ -1,10 +1,22 @@
 package cn.com.ty.lift.system.user.service;
 
+import cn.com.ty.lift.system.entity.User;
+import cn.com.ty.lift.system.entity.UserInfo;
+
 /**
  * <h1>.</h1><BR>
  * @author huangyuan - 2019-11-25 18:36:53
  */
 public interface IUserService{
 
-	
+    /*
+     *@Author huangyuan
+     *@Description 通过用户id获取用户信息
+     *@Date 15:57 2019-11-26
+     *@Param [userId]
+     *@return cn.com.ty.lift.system.entity.User
+     **/
+    User getUserById(String userId);
+
+    void saveUserInfo(UserInfo userInfo);
 }

+ 20 - 0
lift-system-service/src/main/java/cn/com/ty/lift/system/user/service/impl/UserService.java

@@ -1,6 +1,10 @@
 package cn.com.ty.lift.system.user.service.impl;
 
+import cn.com.ty.lift.system.entity.User;
+import cn.com.ty.lift.system.entity.UserInfo;
+import cn.com.ty.lift.system.mapper.UserInfoMapper;
 import cn.com.ty.lift.system.user.service.IUserService;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
@@ -12,4 +16,20 @@ import org.springframework.transaction.annotation.Transactional;
 @Transactional
 public class UserService implements IUserService {
 
+    @Autowired
+    private UserInfoMapper userInfoMapper;
+
+    public User getUserById(String userId) {
+        User user = new User();
+        user.setId(1L);
+        user.setAccount("huangyuan");
+        user.setName("黄远");
+        user.setPassword("123456");
+        return user;
+    }
+
+    @Override
+    public void saveUserInfo(UserInfo userInfo) {
+        userInfoMapper.insert(userInfo);
+    }
 }

+ 14 - 4
lift-system-service/src/main/resources/application.yml

@@ -1,5 +1,13 @@
 server:
   port: 20230
+  tomcat:
+    basedir: /Users/huangyuan/application/tomcat/data/tomcat_temp
+
+
+
+# mybatis-plus配置
+mybatis-plus:
+  mapper-locations: classpath*:/mapper/**Mapper.xml
 
 spring:
   application:
@@ -7,12 +15,14 @@ spring:
   profiles:
     active: dev
   datasource:
-    url: jdbc:mysql://127.0.0.1:3306/portal?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true&serverTimezone=UTC
-    username: mysql
-    password: mysql
+    url: jdbc:mysql://132.232.206.88/rdsliftmanager?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true&serverTimezone=UTC
+    username: root
+    password: ms.c88pocY/
+
 
 #自动添加createTime、isDelete 等字段
 xwy:
   mybatis:
     audit:
-      enabled: true
+      enabled: true
+

+ 259 - 0
lift-system-service/src/main/resources/mapper/UserInfoMapper.xml

@@ -0,0 +1,259 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
+<mapper namespace="cn.com.ty.lift.system.mapper.UserInfoMapper" >
+	<resultMap id="BaseResultMap" type="cn.com.ty.lift.system.entity.UserInfo" >
+		<id column="user_id" property="userId" jdbcType="BIGINT" />
+		<result column="name" property="name" jdbcType="VARCHAR" />
+		<result column="mobile" property="mobile" jdbcType="CHAR" />
+		<result column="gender" property="gender" jdbcType="TINYINT" />
+		<result column="age" property="age" jdbcType="TINYINT" />
+		<result column="remarks" property="remarks" jdbcType="VARCHAR" />
+		<result column="signature" property="signature" jdbcType="VARCHAR" />
+		<result column="service_total" property="serviceTotal" jdbcType="INTEGER" />
+		<result column="satisfaction_total" property="satisfactionTotal" jdbcType="INTEGER" />
+		<result column="level" property="level" jdbcType="INTEGER" />
+		<result column="maintenance_total" property="maintenanceTotal" jdbcType="INTEGER" />
+		<result column="emergency_total" property="emergencyTotal" jdbcType="INTEGER" />
+		<result column="lift_total" property="liftTotal" jdbcType="INTEGER" />
+		<result column="balance" property="balance" jdbcType="DECIMAL" />
+		<result column="type" property="type" jdbcType="VARCHAR" />
+	</resultMap>
+
+	<resultMap id="ResultMapWithBLOBs" type="cn.com.ty.lift.system.entity.UserInfo" extends="BaseResultMap" >
+		<result column="avatar_url" property="avatarUrl" jdbcType="LONGVARCHAR" />
+	</resultMap>
+
+	<sql id="Base_Column_List" >
+		user_id, name, mobile, gender, age, remarks, signature, service_total, satisfaction_total, 
+		level, maintenance_total, emergency_total, lift_total, balance, type
+	</sql>
+
+	<sql id="Blob_Column_List" >
+		avatar_url
+	</sql>
+
+	<select id="selectByPrimaryKey" resultMap="ResultMapWithBLOBs" parameterType="java.lang.Long" >
+		select 
+		<include refid="Base_Column_List" />
+		,
+		<include refid="Blob_Column_List" />
+		from user_info
+		where user_id = #{userId,jdbcType=BIGINT}
+	</select>
+
+	<delete id="deleteByPrimaryKey" parameterType="java.lang.Long" >
+		delete from user_info
+		where user_id = #{userId,jdbcType=BIGINT}
+	</delete>
+
+	<insert id="insert" parameterType="cn.com.ty.lift.system.entity.UserInfo" >
+		insert into user_info (user_id, name, mobile, 
+			gender, age, remarks, 
+			signature, service_total, satisfaction_total, 
+			level, maintenance_total, emergency_total, 
+			lift_total, balance, type, 
+			avatar_url)
+		values (#{userId,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{mobile,jdbcType=CHAR}, 
+			#{gender,jdbcType=TINYINT}, #{age,jdbcType=TINYINT}, #{remarks,jdbcType=VARCHAR}, 
+			#{signature,jdbcType=VARCHAR}, #{serviceTotal,jdbcType=INTEGER}, #{satisfactionTotal,jdbcType=INTEGER}, 
+			#{level,jdbcType=INTEGER}, #{maintenanceTotal,jdbcType=INTEGER}, #{emergencyTotal,jdbcType=INTEGER}, 
+			#{liftTotal,jdbcType=INTEGER}, #{balance,jdbcType=DECIMAL}, #{type,jdbcType=VARCHAR}, 
+			#{avatarUrl,jdbcType=LONGVARCHAR})
+	</insert>
+
+	<insert id="insertSelective" parameterType="cn.com.ty.lift.system.entity.UserInfo" >
+		insert into user_info
+		<trim prefix="(" suffix=")" suffixOverrides="," >
+			<if test="userId != null" >
+				user_id,
+			</if>
+			<if test="name != null" >
+				name,
+			</if>
+			<if test="mobile != null" >
+				mobile,
+			</if>
+			<if test="gender != null" >
+				gender,
+			</if>
+			<if test="age != null" >
+				age,
+			</if>
+			<if test="remarks != null" >
+				remarks,
+			</if>
+			<if test="signature != null" >
+				signature,
+			</if>
+			<if test="serviceTotal != null" >
+				service_total,
+			</if>
+			<if test="satisfactionTotal != null" >
+				satisfaction_total,
+			</if>
+			<if test="level != null" >
+				level,
+			</if>
+			<if test="maintenanceTotal != null" >
+				maintenance_total,
+			</if>
+			<if test="emergencyTotal != null" >
+				emergency_total,
+			</if>
+			<if test="liftTotal != null" >
+				lift_total,
+			</if>
+			<if test="balance != null" >
+				balance,
+			</if>
+			<if test="type != null" >
+				type,
+			</if>
+			<if test="avatarUrl != null" >
+				avatar_url,
+			</if>
+		</trim>
+		<trim prefix="values (" suffix=")" suffixOverrides="," >
+			<if test="userId != null" >
+				#{userId,jdbcType=BIGINT},
+			</if>
+			<if test="name != null" >
+				#{name,jdbcType=VARCHAR},
+			</if>
+			<if test="mobile != null" >
+				#{mobile,jdbcType=CHAR},
+			</if>
+			<if test="gender != null" >
+				#{gender,jdbcType=TINYINT},
+			</if>
+			<if test="age != null" >
+				#{age,jdbcType=TINYINT},
+			</if>
+			<if test="remarks != null" >
+				#{remarks,jdbcType=VARCHAR},
+			</if>
+			<if test="signature != null" >
+				#{signature,jdbcType=VARCHAR},
+			</if>
+			<if test="serviceTotal != null" >
+				#{serviceTotal,jdbcType=INTEGER},
+			</if>
+			<if test="satisfactionTotal != null" >
+				#{satisfactionTotal,jdbcType=INTEGER},
+			</if>
+			<if test="level != null" >
+				#{level,jdbcType=INTEGER},
+			</if>
+			<if test="maintenanceTotal != null" >
+				#{maintenanceTotal,jdbcType=INTEGER},
+			</if>
+			<if test="emergencyTotal != null" >
+				#{emergencyTotal,jdbcType=INTEGER},
+			</if>
+			<if test="liftTotal != null" >
+				#{liftTotal,jdbcType=INTEGER},
+			</if>
+			<if test="balance != null" >
+				#{balance,jdbcType=DECIMAL},
+			</if>
+			<if test="type != null" >
+				#{type,jdbcType=VARCHAR},
+			</if>
+			<if test="avatarUrl != null" >
+				#{avatarUrl,jdbcType=LONGVARCHAR},
+			</if>
+		</trim>
+	</insert>
+
+	<update id="updateByPrimaryKeySelective" parameterType="cn.com.ty.lift.system.entity.UserInfo" >
+		update user_info
+		<set >
+			<if test="name != null" >
+				name = #{name,jdbcType=VARCHAR},
+			</if>
+			<if test="mobile != null" >
+				mobile = #{mobile,jdbcType=CHAR},
+			</if>
+			<if test="gender != null" >
+				gender = #{gender,jdbcType=TINYINT},
+			</if>
+			<if test="age != null" >
+				age = #{age,jdbcType=TINYINT},
+			</if>
+			<if test="remarks != null" >
+				remarks = #{remarks,jdbcType=VARCHAR},
+			</if>
+			<if test="signature != null" >
+				signature = #{signature,jdbcType=VARCHAR},
+			</if>
+			<if test="serviceTotal != null" >
+				service_total = #{serviceTotal,jdbcType=INTEGER},
+			</if>
+			<if test="satisfactionTotal != null" >
+				satisfaction_total = #{satisfactionTotal,jdbcType=INTEGER},
+			</if>
+			<if test="level != null" >
+				level = #{level,jdbcType=INTEGER},
+			</if>
+			<if test="maintenanceTotal != null" >
+				maintenance_total = #{maintenanceTotal,jdbcType=INTEGER},
+			</if>
+			<if test="emergencyTotal != null" >
+				emergency_total = #{emergencyTotal,jdbcType=INTEGER},
+			</if>
+			<if test="liftTotal != null" >
+				lift_total = #{liftTotal,jdbcType=INTEGER},
+			</if>
+			<if test="balance != null" >
+				balance = #{balance,jdbcType=DECIMAL},
+			</if>
+			<if test="type != null" >
+				type = #{type,jdbcType=VARCHAR},
+			</if>
+			<if test="avatarUrl != null" >
+				avatar_url = #{avatarUrl,jdbcType=LONGVARCHAR},
+			</if>
+		</set>
+		where user_id = #{userId,jdbcType=BIGINT}
+	</update>
+
+	<update id="updateByPrimaryKeyWithBLOBs" parameterType="cn.com.ty.lift.system.entity.UserInfo" >
+		update user_info
+		set name = #{name,jdbcType=VARCHAR},
+			mobile = #{mobile,jdbcType=CHAR},
+			gender = #{gender,jdbcType=TINYINT},
+			age = #{age,jdbcType=TINYINT},
+			remarks = #{remarks,jdbcType=VARCHAR},
+			signature = #{signature,jdbcType=VARCHAR},
+			service_total = #{serviceTotal,jdbcType=INTEGER},
+			satisfaction_total = #{satisfactionTotal,jdbcType=INTEGER},
+			level = #{level,jdbcType=INTEGER},
+			maintenance_total = #{maintenanceTotal,jdbcType=INTEGER},
+			emergency_total = #{emergencyTotal,jdbcType=INTEGER},
+			lift_total = #{liftTotal,jdbcType=INTEGER},
+			balance = #{balance,jdbcType=DECIMAL},
+			type = #{type,jdbcType=VARCHAR},
+			avatar_url = #{avatarUrl,jdbcType=LONGVARCHAR}
+		where user_id = #{userId,jdbcType=BIGINT}
+	</update>
+
+	<update id="updateByPrimaryKey" parameterType="cn.com.ty.lift.system.entity.UserInfo" >
+		update user_info
+		set name = #{name,jdbcType=VARCHAR},
+			mobile = #{mobile,jdbcType=CHAR},
+			gender = #{gender,jdbcType=TINYINT},
+			age = #{age,jdbcType=TINYINT},
+			remarks = #{remarks,jdbcType=VARCHAR},
+			signature = #{signature,jdbcType=VARCHAR},
+			service_total = #{serviceTotal,jdbcType=INTEGER},
+			satisfaction_total = #{satisfactionTotal,jdbcType=INTEGER},
+			level = #{level,jdbcType=INTEGER},
+			maintenance_total = #{maintenanceTotal,jdbcType=INTEGER},
+			emergency_total = #{emergencyTotal,jdbcType=INTEGER},
+			lift_total = #{liftTotal,jdbcType=INTEGER},
+			balance = #{balance,jdbcType=DECIMAL},
+			type = #{type,jdbcType=VARCHAR}
+		where user_id = #{userId,jdbcType=BIGINT}
+	</update>
+
+</mapper>