|
@@ -36,9 +36,9 @@ public class SceneCooperationCountServiceImpl extends ServiceImpl<ISceneCooperat
|
|
if(needPay == null || needPay.isEmpty() || size <=0){
|
|
if(needPay == null || needPay.isEmpty() || size <=0){
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
- HashMap<String,Integer> map = new HashMap<>();
|
|
|
|
|
|
+ HashSet<String> strings = new HashSet<>();
|
|
for (ProductCooperation productCooperation : needPay) {
|
|
for (ProductCooperation productCooperation : needPay) {
|
|
- map.merge(productCooperation.getSceneType(), 1, Integer::sum);
|
|
|
|
|
|
+ strings.add(productCooperation.getSceneType() + productCooperation.getNum() + productCooperation.getCooperationUserId());
|
|
}
|
|
}
|
|
|
|
|
|
HashSet<String> hashSet = new HashSet<>();
|
|
HashSet<String> hashSet = new HashSet<>();
|
|
@@ -54,12 +54,12 @@ public class SceneCooperationCountServiceImpl extends ServiceImpl<ISceneCooperat
|
|
SceneCooperationCount count = new SceneCooperationCount();
|
|
SceneCooperationCount count = new SceneCooperationCount();
|
|
count.setSceneType(productCooperation.getSceneType());
|
|
count.setSceneType(productCooperation.getSceneType());
|
|
count.setNum(num);
|
|
count.setNum(num);
|
|
- count.setCount( map.get(productCooperation.getSceneType()));
|
|
|
|
|
|
+ count.setCount( strings.size());
|
|
this.save(count);
|
|
this.save(count);
|
|
}else {
|
|
}else {
|
|
LambdaUpdateWrapper<SceneCooperationCount> wrapper = new LambdaUpdateWrapper<>();
|
|
LambdaUpdateWrapper<SceneCooperationCount> wrapper = new LambdaUpdateWrapper<>();
|
|
wrapper.eq(SceneCooperationCount::getId,byNum.getId());
|
|
wrapper.eq(SceneCooperationCount::getId,byNum.getId());
|
|
- wrapper.set(SceneCooperationCount::getCount, byNum.getCount() + map.get(productCooperation.getSceneType()));
|
|
|
|
|
|
+ wrapper.set(SceneCooperationCount::getCount, byNum.getCount() + strings.size());
|
|
this.update(wrapper);
|
|
this.update(wrapper);
|
|
}
|
|
}
|
|
}
|
|
}
|