Merge branch 'master_test_gn' into master_prb_gn

duhui 2021-07-07 00:30:25 +08:00
commit 1eaeb11f7b
2 changed files with 18 additions and 7 deletions

View File

@ -1,6 +1,5 @@
package com.ljsd.jieling.logic.dao;
import java.io.Serializable;
/**
* @Author hj
@ -8,9 +7,7 @@ import java.io.Serializable;
* @Description:
* @Version 1.0
*/
public class WishDrawCardInfo implements Serializable {
private static final long serialVersionUID = -4813948169695919232L;
public class WishDrawCardInfo implements Cloneable {
private int id;
private int heroTid;
@ -45,4 +42,9 @@ public class WishDrawCardInfo implements Serializable {
public void setStatus(int status) {
this.status = status;
}
@Override
public WishDrawCardInfo clone() throws CloneNotSupportedException {
return (WishDrawCardInfo)super.clone();
}
}

View File

@ -495,7 +495,18 @@ public class HeroLogic{
* @throws ErrorCodeException
*/
public void updateWishDrawCardInfo(User user, List<CommonProto.wishDrawCardInfo> list) throws ErrorCodeException {
HashMap<Integer, WishDrawCardInfo> map = Utils.clone(user.getHeroManager().getWishDrawCardInfoMap());
HashMap<Integer, WishDrawCardInfo> wishDrawCardInfoMap = user.getHeroManager().getWishDrawCardInfoMap();
// 英雄拷贝
HashMap<Integer, WishDrawCardInfo> map = new HashMap<>(wishDrawCardInfoMap.size());
wishDrawCardInfoMap.forEach((k,v)->{
try {
map.put(k,v.clone());
} catch (CloneNotSupportedException e) {
e.printStackTrace();
}
});
// 遍历
for (CommonProto.wishDrawCardInfo v : list) {
WishDrawCardInfo cardInfo = map.get(v.getId());
@ -527,8 +538,6 @@ public class HeroLogic{
else {
user.getHeroManager().setWishDrawCardInfoMap(map);
}
// 推送消息
sendWishCardIndication(user);
}
private void changeRandomItem(User user,int activityId,int[][] random){