提交 5606ffe6 作者: 张小凤

UserService(add)

上级 813a0396
......@@ -86,6 +86,10 @@ public class UserAccountVO implements Serializable {
private String briefIntroduction;
@ApiModelProperty(value = "封面背景图")
private String coverPicture;
@ApiModelProperty(value = "地区最下级id",example = "130100")
private Integer districtChildId;
......
......@@ -192,5 +192,7 @@ public interface UserServiceDao {
int selectUserAccount(UserMessageQO userMessageQO);
int selectUserAccountNickName(UserAccountDO userAccountDO);
String getDistrictChild(Integer districtChildId);
}
......@@ -102,6 +102,12 @@ public class UserAccountDO implements Serializable {
this.accountStatus = userAccountVO.getAccountStatus();
this.remark = userAccountVO.getRemark();
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) {
......
......@@ -149,6 +149,10 @@ public class UserAccountServiceImpl implements UserAccountService {
@Override
public ResultBody update(UserAccountVO userAccountVO) {
UserAccountDO userAccountDO = new UserAccountDO(userAccountVO);
int i = userServiceDao.selectUserAccountNickName(userAccountDO);
if (i!=0){
return ResultBody.error("昵称被占用,请重新修改");
}
userServiceDao.update(userAccountDO);
mqProducer.sentUserInfoChangedMsg(userAccountVO);
return ResultBody.success();
......@@ -193,6 +197,13 @@ public class UserAccountServiceImpl implements UserAccountService {
if (list == 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());
//设置用户的渠道等级
buildCooperationTagVO(accountSimpleDTOS);
......
......@@ -90,7 +90,16 @@
remark = #{remark},
</if>
<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>
</set>
<where>
......@@ -553,6 +562,11 @@
select count(*) from user_account where disable=0 and nick_name=#{nickName} and id!=#{id}
</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
concat( p1.`name`, p2.`name` ) AS region
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论