Commit b9e05f87 by 阮思源

加字段

parent 15f929b2
...@@ -1293,21 +1293,10 @@ public class BookGroupBizImpl implements BookGroupBiz { ...@@ -1293,21 +1293,10 @@ public class BookGroupBizImpl implements BookGroupBiz {
ownAltQrcodeInfoDTO.setAltQrcodeUrl(selfRobotDTO.getQrcodeUrl()); ownAltQrcodeInfoDTO.setAltQrcodeUrl(selfRobotDTO.getQrcodeUrl());
ownAltQrcodeInfoDTO.setAltHeadUrl(selfRobotDTO.getHeadPic()); ownAltQrcodeInfoDTO.setAltHeadUrl(selfRobotDTO.getHeadPic());
//获取之前是否有没有使用的暗号 //获取之前是否有没有使用的暗号
JoinGroupCipher joinGroupCipher = joinGroupCipherDao.getByWechatUserIdAndQrcodeId(wechatUserId, qrcodeId); JoinGroupCipher joinGroupCipher = joinGroupCipherDao.getByWechatUserIdAndQrcodeId(wechatUserId, qrcodeId, CipherTypeEnum.QRCODE_CIPHER.code);
String cipher; String cipher;
if (joinGroupCipher != null) { if (joinGroupCipher != null) {
cipher = joinGroupCipher.getCipher(); cipher = joinGroupCipher.getCipher();
//避免之前通过社群码入群
if (!CipherTypeEnum.QRCODE_CIPHER.code.equals(joinGroupCipher.getType())){
cipher = UUIDUitl.generateShort();
//查重,如果有重复,再次生成
JoinGroupCipher joinGroupCipherHas = joinGroupCipherDao.getByCipher(cipher);
if (joinGroupCipherHas != null) {
cipher = UUIDUitl.generateShort();
}
//更新
joinGroupCipherDao.updateCipher(joinGroupCipher.getId(), cipher);
}
} else { } else {
//新增暗号 //新增暗号
cipher = UUIDUitl.generateShort(); cipher = UUIDUitl.generateShort();
......
...@@ -28,7 +28,7 @@ public interface JoinGroupCipherDao extends BaseDao<JoinGroupCipher> { ...@@ -28,7 +28,7 @@ public interface JoinGroupCipherDao extends BaseDao<JoinGroupCipher> {
*/ */
BigDecimal getPayPrice(String wxId, Long qrcodeId); BigDecimal getPayPrice(String wxId, Long qrcodeId);
JoinGroupCipher getByWechatUserIdAndQrcodeId(Long wechatUserId, Long qrcodeId); JoinGroupCipher getByWechatUserIdAndQrcodeId(Long wechatUserId, Long qrcodeId, Integer type);
void updateCipher(Long id, String cipher); void updateCipher(Long id, String cipher);
} }
...@@ -71,10 +71,11 @@ public class JoinGroupCipherDaoImpl extends BaseDaoImpl<JoinGroupCipher> impleme ...@@ -71,10 +71,11 @@ public class JoinGroupCipherDaoImpl extends BaseDaoImpl<JoinGroupCipher> impleme
} }
@Override @Override
public JoinGroupCipher getByWechatUserIdAndQrcodeId(Long wechatUserId, Long qrcodeId) { public JoinGroupCipher getByWechatUserIdAndQrcodeId(Long wechatUserId, Long qrcodeId, Integer type) {
Map<String,Object> map=new HashMap<>(); Map<String,Object> map=new HashMap<>();
map.put("wechatUserId",wechatUserId); map.put("wechatUserId",wechatUserId);
map.put("qrcodeId",qrcodeId); map.put("qrcodeId",qrcodeId);
map.put("type",type);
return this.getSqlSession().selectOne(this.getStatement("getByWechatUserIdAndQrcodeId"), map); return this.getSqlSession().selectOne(this.getStatement("getByWechatUserIdAndQrcodeId"), map);
} }
......
...@@ -109,7 +109,8 @@ ...@@ -109,7 +109,8 @@
<select id="getByWechatUserIdAndQrcodeId" parameterType="map" resultMap="BaseResultMap"> <select id="getByWechatUserIdAndQrcodeId" parameterType="map" resultMap="BaseResultMap">
select <include refid="Base_Column_List"/> from join_group_cipher select <include refid="Base_Column_List"/> from join_group_cipher
where wechat_user_id=#{wechatUserId} and where wechat_user_id=#{wechatUserId} and
qrcode_id=#{qrcode_id} qrcode_id=#{qrcodeId} and
type=#{type} limit 1
</select> </select>
<!--更新暗号--> <!--更新暗号-->
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment