Commit 57951bab authored by jiaorz's avatar jiaorz

获取用户是否参加活动

parent cc37acac
...@@ -99,7 +99,7 @@ public class ActivityPopularizeBiz extends BaseBiz<ActivityPopularizeMapper,Acti ...@@ -99,7 +99,7 @@ public class ActivityPopularizeBiz extends BaseBiz<ActivityPopularizeMapper,Acti
//新增第几个邀请人和邀请金额字段 //新增第几个邀请人和邀请金额字段
Integer num = relationBiz.getByUserIdAndPopularizeId(activityPopularizeRelation); Integer num = relationBiz.getByUserIdAndPopularizeId(activityPopularizeRelation);
BigDecimal amount = new BigDecimal(0); Integer amount = 0;
JSONObject jsonObject = JSONObject.parseObject(activityPopularizeItem.getDetail()); JSONObject jsonObject = JSONObject.parseObject(activityPopularizeItem.getDetail());
if (jsonObject != null && StringUtils.isNotBlank(jsonObject.getString("detail"))) { if (jsonObject != null && StringUtils.isNotBlank(jsonObject.getString("detail"))) {
JSONArray jsonArray = JSONArray.parseArray(jsonObject.getString("detail")); JSONArray jsonArray = JSONArray.parseArray(jsonObject.getString("detail"));
...@@ -107,17 +107,18 @@ public class ActivityPopularizeBiz extends BaseBiz<ActivityPopularizeMapper,Acti ...@@ -107,17 +107,18 @@ public class ActivityPopularizeBiz extends BaseBiz<ActivityPopularizeMapper,Acti
JSONObject jsonObject1 = jsonArray.getJSONObject(num - 1); JSONObject jsonObject1 = jsonArray.getJSONObject(num - 1);
if (jsonObject1 != null) { if (jsonObject1 != null) {
Integer amountString = jsonObject1.getInteger("amount"); Integer amountString = jsonObject1.getInteger("amount");
amount.add(new BigDecimal(amountString)); amount = amount + amountString;
} }
} }
} }
Integer a = amount;
//添加活动关系 //添加活动关系
relationBiz.insertSelective(new ActivityPopularizeRelation(){{ relationBiz.insertSelective(new ActivityPopularizeRelation(){{
setPopularizeId(activityPopularize.getId()); setPopularizeId(activityPopularize.getId());
setMajorUserId(majorUserId); setMajorUserId(majorUserId);
setMinorUserId(appUserDTO.getUserid()); setMinorUserId(appUserDTO.getUserid());
setNum(num); setNum(num);
setAmount(amount); setAmount(new BigDecimal(a));
}}); }});
ApLogDTO apLogDTO = popularizeLogBiz.selectOneApLogDTO(new ActivityPopularizeLog(){{ ApLogDTO apLogDTO = popularizeLogBiz.selectOneApLogDTO(new ActivityPopularizeLog(){{
...@@ -141,7 +142,7 @@ public class ActivityPopularizeBiz extends BaseBiz<ActivityPopularizeMapper,Acti ...@@ -141,7 +142,7 @@ public class ActivityPopularizeBiz extends BaseBiz<ActivityPopularizeMapper,Acti
setPopularizeId(activityPopularize.getId()); setPopularizeId(activityPopularize.getId());
}}); }});
//修改当前进度 //修改当前进度
activityPopularizeUser.setCurrentProgress(activityPopularizeUser.getCurrentProgress().add(amount)); activityPopularizeUser.setCurrentProgress(activityPopularizeUser.getCurrentProgress().add(new BigDecimal(a)));
//任务没有完成 //任务没有完成
if(!SYS_TRUE.equals(activityPopularizeUser.getStatus())) { if(!SYS_TRUE.equals(activityPopularizeUser.getStatus())) {
// AwardDTO awardDTO = JSONUtil.toBean(activityPopularize.getValue(), AwardDTO.class); // AwardDTO awardDTO = JSONUtil.toBean(activityPopularize.getValue(), AwardDTO.class);
......
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