提交 5606ffe6 作者: 张小凤

UserService(add)

上级 813a0396
...@@ -86,6 +86,10 @@ public class UserAccountVO implements Serializable { ...@@ -86,6 +86,10 @@ public class UserAccountVO implements Serializable {
private String briefIntroduction; private String briefIntroduction;
@ApiModelProperty(value = "封面背景图") @ApiModelProperty(value = "封面背景图")
private String coverPicture; private String coverPicture;
@ApiModelProperty(value = "地区最下级id",example = "130100")
private Integer districtChildId;
......
...@@ -192,5 +192,7 @@ public interface UserServiceDao { ...@@ -192,5 +192,7 @@ public interface UserServiceDao {
int selectUserAccount(UserMessageQO userMessageQO); int selectUserAccount(UserMessageQO userMessageQO);
int selectUserAccountNickName(UserAccountDO userAccountDO);
String getDistrictChild(Integer districtChildId); String getDistrictChild(Integer districtChildId);
} }
...@@ -102,6 +102,12 @@ public class UserAccountDO implements Serializable { ...@@ -102,6 +102,12 @@ public class UserAccountDO implements Serializable {
this.accountStatus = userAccountVO.getAccountStatus(); this.accountStatus = userAccountVO.getAccountStatus();
this.remark = userAccountVO.getRemark(); this.remark = userAccountVO.getRemark();
this.portType = userAccountVO.getPortType(); this.portType = userAccountVO.getPortType();
this.userImg=userAccountVO.getUserImg();
this.coverPicture=userAccountVO.getCoverPicture();
this.nickName=userAccountVO.getNickName();
this.districtChildId=userAccountVO.getDistrictChildId();
this.briefIntroduction= userAccountVO.getBriefIntroduction();
} }
public UserAccountDO(BUserAccountVO bUserAccountVO) { public UserAccountDO(BUserAccountVO bUserAccountVO) {
......
...@@ -149,6 +149,10 @@ public class UserAccountServiceImpl implements UserAccountService { ...@@ -149,6 +149,10 @@ public class UserAccountServiceImpl implements UserAccountService {
@Override @Override
public ResultBody update(UserAccountVO userAccountVO) { public ResultBody update(UserAccountVO userAccountVO) {
UserAccountDO userAccountDO = new UserAccountDO(userAccountVO); UserAccountDO userAccountDO = new UserAccountDO(userAccountVO);
int i = userServiceDao.selectUserAccountNickName(userAccountDO);
if (i!=0){
return ResultBody.error("昵称被占用,请重新修改");
}
userServiceDao.update(userAccountDO); userServiceDao.update(userAccountDO);
mqProducer.sentUserInfoChangedMsg(userAccountVO); mqProducer.sentUserInfoChangedMsg(userAccountVO);
return ResultBody.success(); return ResultBody.success();
...@@ -193,6 +197,13 @@ public class UserAccountServiceImpl implements UserAccountService { ...@@ -193,6 +197,13 @@ public class UserAccountServiceImpl implements UserAccountService {
if (list == null) { if (list == null) {
return null; return null;
} }
for (UserAccountDO userAccountDO : list) {
Integer districtChildId = userAccountDO.getDistrictChildId();
if (districtChildId!=null){
String districtChild = userServiceDao.getDistrictChild(districtChildId);
userAccountDO.setRegion(districtChild);
}
}
List<UserAccountSimpleDTO> accountSimpleDTOS = list.stream().map(UserAccountDO::buildUserAccountSimpleDTO).collect(Collectors.toList()); List<UserAccountSimpleDTO> accountSimpleDTOS = list.stream().map(UserAccountDO::buildUserAccountSimpleDTO).collect(Collectors.toList());
//设置用户的渠道等级 //设置用户的渠道等级
buildCooperationTagVO(accountSimpleDTOS); buildCooperationTagVO(accountSimpleDTOS);
......
...@@ -90,7 +90,16 @@ ...@@ -90,7 +90,16 @@
remark = #{remark}, remark = #{remark},
</if> </if>
<if test="portType != null"> <if test="portType != null">
port_type = #{portType} port_type = #{portType},
</if>
<if test="coverPicture!='' and coverPicture!=null">
cover_picture=#{coverPicture},
</if>
<if test="districtChildId!=null">
district_child_id=#{districtChildId},
</if>
<if test="briefIntroduction!='' and briefIntroduction!=null">
brief_introduction=#{briefIntroduction}
</if> </if>
</set> </set>
<where> <where>
...@@ -553,6 +562,11 @@ ...@@ -553,6 +562,11 @@
select count(*) from user_account where disable=0 and nick_name=#{nickName} and id!=#{id} select count(*) from user_account where disable=0 and nick_name=#{nickName} and id!=#{id}
</select> </select>
<select id="selectUserAccountNickName" resultType="java.lang.Integer"
parameterType="com.mmc.iuav.user.entity.UserAccountDO">
select count(*) from user_account where disable=0 and nick_name=#{nickName} and id!=#{id}
</select>
<select id="getDistrictChild" resultType="java.lang.String"> <select id="getDistrictChild" resultType="java.lang.String">
SELECT SELECT
concat( p1.`name`, p2.`name` ) AS region concat( p1.`name`, p2.`name` ) AS region
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论