新增修改公众号账号标识功能

This commit is contained in:
wanggeng888 2021-05-02 16:20:31 +08:00
parent cf2a053fa8
commit 49dca764be
4 changed files with 60 additions and 2 deletions

View File

@ -49,11 +49,19 @@ public interface IOfficialAccountUserDao {
/** /**
* 修改用户码邀请码 * 修改用户码邀请码
*
* @param params * @param params
* @throws UpdateException * @throws UpdateException
*/ */
void updateUserCode(Map<String, Object> params) throws UpdateException; void updateUserCode(Map<String, Object> params) throws UpdateException;
/**
* 修改初始账号标识
* @param params
* @throws UpdateException
*/
void updateIsInitAccount(Map<String, Object> params) throws UpdateException;
/** /**
* 删除 * 删除
* *
@ -98,4 +106,5 @@ public interface IOfficialAccountUserDao {
*/ */
List<OfficialAccountUserPO> listPO(Map<String, Object> params) throws SearchException; List<OfficialAccountUserPO> listPO(Map<String, Object> params) throws SearchException;
} }

View File

@ -1,6 +1,5 @@
package ink.wgink.module.wechat.service.official.account; package ink.wgink.module.wechat.service.official.account;
import ink.wgink.interfaces.wechat.official.account.IAccountOfficialUserBaseService;
import ink.wgink.module.wechat.enums.XmlEventTypeEnum; import ink.wgink.module.wechat.enums.XmlEventTypeEnum;
import ink.wgink.module.wechat.pojo.dtos.official.account.OfficialAccountUserDTO; import ink.wgink.module.wechat.pojo.dtos.official.account.OfficialAccountUserDTO;
import ink.wgink.module.wechat.pojo.pos.official.account.OfficialAccountUserPO; import ink.wgink.module.wechat.pojo.pos.official.account.OfficialAccountUserPO;
@ -21,7 +20,7 @@ import java.util.Map;
* @Date: 2021/4/28 6:15 下午 * @Date: 2021/4/28 6:15 下午
* @Version: 1.0 * @Version: 1.0
*/ */
public interface IOfficialAccountUserService extends IAccountOfficialUserBaseService { public interface IOfficialAccountUserService {
/** /**
* 公众号用户前缀 * 公众号用户前缀
@ -43,6 +42,14 @@ public interface IOfficialAccountUserService extends IAccountOfficialUserBaseSer
*/ */
void updateStatus(String openId, XmlEventTypeEnum xmlEventTypeEnum); void updateStatus(String openId, XmlEventTypeEnum xmlEventTypeEnum);
/**
* 修改初始账号标识
*
* @param openId
* @param isInitAccount
*/
void updateIsInitAccount(String openId, int isInitAccount);
/** /**
* 详情 * 详情
* *
@ -108,4 +115,13 @@ public interface IOfficialAccountUserService extends IAccountOfficialUserBaseSer
* @return * @return
*/ */
String getUserCodeByOpenId(String openId); String getUserCodeByOpenId(String openId);
/**
* 用户码获取用户
*
* @param userCode
* @return
*/
OfficialAccountUserPO getPOByUserCode(String userCode);
} }

View File

@ -96,6 +96,15 @@ public class OfficialAccountUserServiceImpl extends DefaultBaseService implement
officialAccountUserDao.update(params); officialAccountUserDao.update(params);
} }
@Override
public void updateIsInitAccount(String openId, int isInitAccount) {
Map<String, Object> params = getHashMap(4);
params.put("appId", officialAccountProperties.getAppId());
params.put("openId", openId);
params.put("isInitAccount", isInitAccount);
officialAccountUserDao.updateIsInitAccount(params);
}
@Override @Override
public OfficialAccountUserDTO get(Map<String, Object> params) { public OfficialAccountUserDTO get(Map<String, Object> params) {
return officialAccountUserDao.get(params); return officialAccountUserDao.get(params);
@ -143,6 +152,12 @@ public class OfficialAccountUserServiceImpl extends DefaultBaseService implement
return officialAccountUserPO.getUserCode(); return officialAccountUserPO.getUserCode();
} }
@Override
public OfficialAccountUserPO getPOByUserCode(String userCode) {
Map<String, Object> params = getHashMap(2);
params.put("userCode", userCode);
return getPO(params);
}
/** /**
* 更新用户码邀请码 * 更新用户码邀请码

View File

@ -110,6 +110,20 @@
</update> </update>
<!-- 修改用户码(邀请码) -->
<update id="updateIsInitAccount" parameterType="map" flushCache="true">
UPDATE
wechat_official_account_user
SET
is_init_account = #{isInitAccount}
WHERE
app_id = #{appId}
AND
open_id = #{openId}
</update>
<!-- 详情 --> <!-- 详情 -->
<select id="get" parameterType="map" resultMap="officialAccountUserDTO" useCache="true"> <select id="get" parameterType="map" resultMap="officialAccountUserDTO" useCache="true">
SELECT SELECT
@ -181,6 +195,10 @@
AND AND
user_id = #{userId} user_id = #{userId}
</if> </if>
<if test="userCode != null and userCode != ''">
AND
user_code = #{userCode}
</if>
</where> </where>
</select> </select>