|
|
@@ -724,6 +724,7 @@ public class ActivityServiceImpl extends ServiceImpl<ActivityDao, ActivityEntity
|
|
|
activityStu.setFromTo("1");
|
|
|
activityStu.setCreateTime(DateFormatUtils.format(now, "yyyy-MM-dd HH:mm:ss"));
|
|
|
activityStu.setCreateId((long) 0);
|
|
|
+ activityStu.setIsDelete("0");
|
|
|
activityStuDao.insert(activityStu);
|
|
|
count = activityStuDao.selectCount(
|
|
|
new QueryWrapper<ActivityStuEntity>().eq("activity_id", actId).eq("is_delete", 0).eq("status", "01"));
|
|
|
@@ -861,68 +862,67 @@ public class ActivityServiceImpl extends ServiceImpl<ActivityDao, ActivityEntity
|
|
|
return register;
|
|
|
}
|
|
|
}
|
|
|
- try {
|
|
|
- // 走积分
|
|
|
- if (money.compareTo(BigDecimal.ZERO) == 0 && points.compareTo(BigDecimal.ZERO) > 0){
|
|
|
- if (BigDecimal.valueOf(totalScore).compareTo(points) < 0) {
|
|
|
- return R.error(522, "积分不够报名!");
|
|
|
- }
|
|
|
- // 直接走免费报名接口
|
|
|
- R register = register(params);
|
|
|
- ScoreStu add = new ScoreStu();
|
|
|
- add.setDay(DateForStr.getInfoDateStr(new Date()));
|
|
|
- add.setStuId(stuId);
|
|
|
- add.setScoreType(ScoreType.STORE_SCORE.getCode());
|
|
|
- add.setTaskId(TaskType.ACTIVITY_APPLY_DEDUCT.getCode());
|
|
|
- add.setBusinessId(actId);
|
|
|
- add.setScoreEvent(TaskType.ACTIVITY_APPLY_DEDUCT.getInfo());
|
|
|
- add.setScoreValue(NumberUtil.sub(BigDecimal.ZERO, points).intValue());
|
|
|
- add.setCreateTime(new Date());
|
|
|
- add.setSurplusScore(NumberUtil.sub(BigDecimal.ZERO, points).intValue() + this.scoreStuService.getTotalScore(stuId));
|
|
|
- scoreStuMapper.insert(add);
|
|
|
- Integer code = (Integer) register.get("code");
|
|
|
- if (0 == code) {
|
|
|
- member.setActFree("0");
|
|
|
- memberInfoDao.updateById(member);
|
|
|
- String activityStuId = (String) register.getOrDefault("activityStuId", null);
|
|
|
- if (StrUtil.isNotEmpty(activityStuId)) {
|
|
|
- //更新会员报名抵扣积分ID
|
|
|
- activityStuDao.update(null,
|
|
|
- new LambdaUpdateWrapper<ActivityStuEntity>()
|
|
|
- .set(ActivityStuEntity::getScoreRecordId, add.getId())
|
|
|
- .eq(ActivityStuEntity::getId, Long.valueOf(activityStuId)));
|
|
|
- }
|
|
|
+ // 走积分
|
|
|
+ if (money.compareTo(BigDecimal.ZERO) == 0 && points.compareTo(BigDecimal.ZERO) > 0) {
|
|
|
+ if (BigDecimal.valueOf(totalScore).compareTo(points) < 0) {
|
|
|
+ return R.error(522, "积分不够报名!");
|
|
|
+ }
|
|
|
+ // 直接走免费报名接口
|
|
|
+ R register = register(params);
|
|
|
+ ScoreStu add = new ScoreStu();
|
|
|
+ add.setDay(DateForStr.getInfoDateStr(new Date()));
|
|
|
+ add.setStuId(stuId);
|
|
|
+ add.setScoreType(ScoreType.STORE_SCORE.getCode());
|
|
|
+ add.setTaskId(TaskType.ACTIVITY_APPLY_DEDUCT.getCode());
|
|
|
+ add.setBusinessId(actId);
|
|
|
+ add.setScoreEvent(TaskType.ACTIVITY_APPLY_DEDUCT.getInfo());
|
|
|
+ add.setScoreValue(NumberUtil.sub(BigDecimal.ZERO, points).intValue());
|
|
|
+ add.setCreateTime(new Date());
|
|
|
+ add.setSurplusScore(NumberUtil.sub(BigDecimal.ZERO, points).intValue() + this.scoreStuService.getTotalScore(stuId));
|
|
|
+ scoreStuMapper.insert(add);
|
|
|
+ HashMap resultMap = (HashMap) register.get("map");
|
|
|
+ if ("0".equals((String) resultMap.get("code"))) {
|
|
|
+ member.setActFree("0");
|
|
|
+ memberInfoDao.updateById(member);
|
|
|
+ String activityStuId = (String) resultMap.getOrDefault("activityStuId", null);
|
|
|
+ if (StrUtil.isNotEmpty(activityStuId)) {
|
|
|
+ //更新会员报名抵扣积分ID
|
|
|
+ activityStuDao.update(null,
|
|
|
+ new LambdaUpdateWrapper<ActivityStuEntity>()
|
|
|
+ .set(ActivityStuEntity::getScoreRecordId, add.getId())
|
|
|
+ .eq(ActivityStuEntity::getId, Long.valueOf(activityStuId)));
|
|
|
}
|
|
|
- return register;
|
|
|
- } else {
|
|
|
- // 支付信息
|
|
|
- ActivityStuPayinfoEntity activityStuPayinfoEntity = new ActivityStuPayinfoEntity();
|
|
|
- activityStuPayinfoEntity.setActivityId(actId);
|
|
|
- activityStuPayinfoEntity.setStuId(stuId);
|
|
|
- activityStuPayinfoEntity.setCreateTime(DateFormatUtils.format(now, "yyyy-MM-dd HH:mm:ss"));
|
|
|
- activityStuPayinfoEntity.setPayStatus(0);
|
|
|
- activityStuPayinfoEntity.setPayMoney(money);
|
|
|
- activityStuPayinfoEntity.setPayNo(MD5Util.getUUID16());
|
|
|
- activityStuPayinfoService.save(activityStuPayinfoEntity);
|
|
|
-
|
|
|
- // 允许报名 ,调起微信
|
|
|
- String notifyUrl = PropertiesParameter.PROP.getProperty("pay.notify.activity.url");
|
|
|
- String openid = member.getOpenid();
|
|
|
- OrderBusinessTypeEnum typeEnum = OrderBusinessTypeEnum.PURCHASE_ACTIVITY;
|
|
|
- PayForBO bo = new PayForBO();
|
|
|
- bo.setNotifyUrl(notifyUrl);
|
|
|
- bo.setOpenid(openid);
|
|
|
- bo.setMemberId(stuId);
|
|
|
- bo.setBusinessId(actId);
|
|
|
- bo.setBusinessType(typeEnum.value());
|
|
|
- bo.setBuyContent(activity.getTitle());
|
|
|
- bo.setPayTime(LocalDateTime.now());
|
|
|
- bo.setPrice(money);
|
|
|
- bo.setActuallyPaid(money);
|
|
|
- bo.setPointsDeduction(BigDecimal.ZERO);
|
|
|
- bo.setCode(TaskConfigEnum.ACTIVITY.code());
|
|
|
- return R.ok().put("map", orderService.payFor(bo));
|
|
|
}
|
|
|
+ return register;
|
|
|
+ }
|
|
|
+ try {
|
|
|
+ // 支付信息
|
|
|
+ ActivityStuPayinfoEntity activityStuPayinfoEntity = new ActivityStuPayinfoEntity();
|
|
|
+ activityStuPayinfoEntity.setActivityId(actId);
|
|
|
+ activityStuPayinfoEntity.setStuId(stuId);
|
|
|
+ activityStuPayinfoEntity.setCreateTime(DateFormatUtils.format(now, "yyyy-MM-dd HH:mm:ss"));
|
|
|
+ activityStuPayinfoEntity.setPayStatus(0);
|
|
|
+ activityStuPayinfoEntity.setPayMoney(money);
|
|
|
+ activityStuPayinfoEntity.setPayNo(MD5Util.getUUID16());
|
|
|
+ activityStuPayinfoService.save(activityStuPayinfoEntity);
|
|
|
+
|
|
|
+ // 允许报名 ,调起微信
|
|
|
+ String notifyUrl = PropertiesParameter.PROP.getProperty("pay.notify.activity.url");
|
|
|
+ String openid = member.getOpenid();
|
|
|
+ OrderBusinessTypeEnum typeEnum = OrderBusinessTypeEnum.PURCHASE_ACTIVITY;
|
|
|
+ PayForBO bo = new PayForBO();
|
|
|
+ bo.setNotifyUrl(notifyUrl);
|
|
|
+ bo.setOpenid(openid);
|
|
|
+ bo.setMemberId(stuId);
|
|
|
+ bo.setBusinessId(actId);
|
|
|
+ bo.setBusinessType(typeEnum.value());
|
|
|
+ bo.setBuyContent(activity.getTitle());
|
|
|
+ bo.setPayTime(LocalDateTime.now());
|
|
|
+ bo.setPrice(money);
|
|
|
+ bo.setActuallyPaid(money);
|
|
|
+ bo.setPointsDeduction(BigDecimal.ZERO);
|
|
|
+ bo.setCode(TaskConfigEnum.ACTIVITY.code());
|
|
|
+ return R.ok().put("map", orderService.payFor(bo));
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
return R.error("微信支付异常!");
|