Sfoglia il codice sorgente

fix:管理员用户同步手机号

liujunchi 2 anni fa
parent
commit
b53ac3354c

+ 1 - 1
mec-client-api/src/main/java/com/ym/mec/web/WebFeignService.java

@@ -64,6 +64,6 @@ public interface WebFeignService {
 	HttpResponseResult<Map<String,String>> getBaseUrl(@RequestParam("orderNo") String orderNo);
 
 	// 商城获取 退款数据
-	@PostMapping("/refund")
+	@PostMapping("/api/refund")
 	HttpResponseResult<BaseResult<Map<String, Object>>> refund(@RequestBody RefundModel refundModel);
 }

+ 3 - 0
mec-mall/mall-admin/src/main/java/com/yonge/cooleshow/admin/controller/UmsRoleController.java

@@ -52,6 +52,9 @@ public class UmsRoleController {
         if (ids.stream().anyMatch(id -> id.equals(1L))) {
             return CommonResult.failed("默认角色不能删除");
         }
+        if (ids.stream().anyMatch(id -> id.equals(9L))) {
+            return CommonResult.failed("默认角色不能删除");
+        }
         int count = roleService.delete(ids);
         if (count > 0) {
             return CommonResult.success(count);

+ 2 - 1
mec-mall/mall-admin/src/main/java/com/yonge/cooleshow/admin/service/impl/UmsAdminServiceImpl.java

@@ -244,6 +244,7 @@ public class UmsAdminServiceImpl implements UmsAdminService {
         admin.setNickName(row.getUsername());
         admin.setPassword(row.getPassword());
         admin.setStatus(1);
+        admin.setPhone(row.getPhone());
         admin.setIcon(row.getAvatar());
         return admin;
     }
@@ -280,7 +281,7 @@ public class UmsAdminServiceImpl implements UmsAdminService {
         for (Long adminId : adminIdList) {
             UmsAdminRoleRelation roleRelation = new UmsAdminRoleRelation();
             roleRelation.setAdminId(adminId);
-            roleRelation.setRoleId(1L);
+            roleRelation.setRoleId(9L);
             list.add(roleRelation);
         }
         return adminRoleRelationDao.insertList(list) > 0;

+ 11 - 0
mec-mall/mall-mbg/src/main/java/com/yonge/cooleshow/mbg/model/UmsAdmin.java

@@ -32,8 +32,19 @@ public class UmsAdmin implements Serializable {
     @ApiModelProperty(value = "帐号启用状态:0->禁用;1->启用")
     private Integer status;
 
+    @ApiModelProperty("手机号")
+    private String phone;
+
     private static final long serialVersionUID = 1L;
 
+    public String getPhone() {
+        return phone;
+    }
+
+    public void setPhone(String phone) {
+        this.phone = phone;
+    }
+
     public Long getId() {
         return id;
     }

+ 22 - 7
mec-mall/mall-mbg/src/main/resources/config/mybatis/UmsAdminMapper.xml

@@ -8,6 +8,7 @@
     <result column="icon" jdbcType="VARCHAR" property="icon" />
     <result column="email" jdbcType="VARCHAR" property="email" />
     <result column="nick_name" jdbcType="VARCHAR" property="nickName" />
+    <result column="phone" jdbcType="VARCHAR" property="phone" />
     <result column="note" jdbcType="VARCHAR" property="note" />
     <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
     <result column="login_time" jdbcType="TIMESTAMP" property="loginTime" />
@@ -72,7 +73,7 @@
     </where>
   </sql>
   <sql id="Base_Column_List">
-    id, username, password, icon, email, nick_name, note, create_time, login_time, status
+    id, username, password, icon, email, nick_name, note, create_time, login_time, status,phone
   </sql>
   <select id="selectByExample" parameterType="com.yonge.cooleshow.mbg.model.UmsAdminExample" resultMap="BaseResultMap">
     select
@@ -110,11 +111,11 @@
     </selectKey>
     insert into ums_admin (username, password, icon, 
       email, nick_name, note, 
-      create_time, login_time, status
+      create_time, login_time, status,phone
       )
     values (#{username,jdbcType=VARCHAR}, #{password,jdbcType=VARCHAR}, #{icon,jdbcType=VARCHAR}, 
       #{email,jdbcType=VARCHAR}, #{nickName,jdbcType=VARCHAR}, #{note,jdbcType=VARCHAR}, 
-      #{createTime,jdbcType=TIMESTAMP}, #{loginTime,jdbcType=TIMESTAMP}, #{status,jdbcType=INTEGER}
+      #{createTime,jdbcType=TIMESTAMP}, #{loginTime,jdbcType=TIMESTAMP}, #{status,jdbcType=INTEGER},#{phone}
       )
   </insert>
   <insert id="insertSelective" parameterType="com.yonge.cooleshow.mbg.model.UmsAdmin">
@@ -150,6 +151,9 @@
       <if test="status != null">
         status,
       </if>
+      <if test="phone != null">
+        phone,
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
       <if test="username != null">
@@ -179,6 +183,9 @@
       <if test="status != null">
         #{status,jdbcType=INTEGER},
       </if>
+      <if test="phone != null">
+        #{phone},
+      </if>
     </trim>
   </insert>
   <select id="countByExample" parameterType="com.yonge.cooleshow.mbg.model.UmsAdminExample" resultType="java.lang.Long">
@@ -220,6 +227,9 @@
       <if test="record.status != null">
         status = #{record.status,jdbcType=INTEGER},
       </if>
+      <if test="record.phone != null">
+        phone = #{record.phone},
+      </if>
     </set>
     <if test="_parameter != null">
       <include refid="Update_By_Example_Where_Clause" />
@@ -236,6 +246,7 @@
       note = #{record.note,jdbcType=VARCHAR},
       create_time = #{record.createTime,jdbcType=TIMESTAMP},
       login_time = #{record.loginTime,jdbcType=TIMESTAMP},
+      phone = #{record.phone},
       status = #{record.status,jdbcType=INTEGER}
     <if test="_parameter != null">
       <include refid="Update_By_Example_Where_Clause" />
@@ -271,6 +282,9 @@
       <if test="status != null">
         status = #{status,jdbcType=INTEGER},
       </if>
+      <if test="phone != null">
+        phone = #{phone},
+      </if>
     </set>
     where id = #{id,jdbcType=BIGINT}
   </update>
@@ -284,6 +298,7 @@
       note = #{note,jdbcType=VARCHAR},
       create_time = #{createTime,jdbcType=TIMESTAMP},
       login_time = #{loginTime,jdbcType=TIMESTAMP},
+      phone = #{phone},
       status = #{status,jdbcType=INTEGER}
     where id = #{id,jdbcType=BIGINT}
   </update>
@@ -291,24 +306,24 @@
   <insert id="addRootAdmin"  parameterType="com.yonge.cooleshow.mbg.model.UmsAdmin">
     insert into ums_admin (id,username, password, icon,
     email, nick_name, note,
-    create_time, login_time, status
+    create_time, login_time, status,phone
     )
     values (#{id,jdbcType=BIGINT},#{username,jdbcType=VARCHAR}, #{password,jdbcType=VARCHAR}, #{icon,jdbcType=VARCHAR},
     #{email,jdbcType=VARCHAR}, #{nickName,jdbcType=VARCHAR}, #{note,jdbcType=VARCHAR},
-    #{createTime,jdbcType=TIMESTAMP}, #{loginTime,jdbcType=TIMESTAMP}, #{status,jdbcType=INTEGER}
+    #{createTime,jdbcType=TIMESTAMP}, #{loginTime,jdbcType=TIMESTAMP}, #{status,jdbcType=INTEGER},#{phone}
     )
   </insert>
 
   <insert id="saveRootAdminList">
     replace into ums_admin (id,username, password, icon,
     email, nick_name, note,
-    create_time, login_time, status
+    create_time, login_time, status,phone
     )
     values
     <foreach collection="adminList" separator="," close="" open="" item="item">
       (#{item.id,jdbcType=BIGINT},#{item.username,jdbcType=VARCHAR}, #{item.password,jdbcType=VARCHAR}, #{item.icon,jdbcType=VARCHAR},
       #{item.email,jdbcType=VARCHAR}, #{item.nickName,jdbcType=VARCHAR}, #{item.note,jdbcType=VARCHAR},
-      #{item.createTime,jdbcType=TIMESTAMP}, #{item.loginTime,jdbcType=TIMESTAMP}, #{item.status,jdbcType=INTEGER}
+      #{item.createTime,jdbcType=TIMESTAMP}, #{item.loginTime,jdbcType=TIMESTAMP}, #{item.status,jdbcType=INTEGER},#{item.phone}
       )
     </foreach>
   </insert>