|
|
@@ -321,9 +321,9 @@ public class MeetServiceImpl extends ServiceImpl<MeetMapper, MeetEntity> impleme
|
|
|
add.setDay(DateForStr.getInfoDateStr(new Date()));
|
|
|
add.setStuId(memberInfoEntity.getId());
|
|
|
add.setScoreType(ScoreType.STORE_SCORE.getCode());
|
|
|
- add.setTaskId(TaskType.WORK_APPLY_DEDUCT.getCode());
|
|
|
- add.setBusinessId(TaskType.WORK_APPLY_DEDUCT.getCode());
|
|
|
- add.setScoreEvent(TaskType.WORK_APPLY_DEDUCT.getInfo());
|
|
|
+ add.setTaskId(TaskType.MEET_APPLY_DEDUCT.getCode());
|
|
|
+ add.setBusinessId(meetEntity.getId());
|
|
|
+ add.setScoreEvent(TaskType.MEET_APPLY_DEDUCT.getInfo());
|
|
|
add.setScoreValue(NumberUtil.sub(BigDecimal.ZERO, usePoints).intValue());
|
|
|
add.setCreateTime(new Date());
|
|
|
add.setSurplusScore(NumberUtil.sub(BigDecimal.ZERO, usePoints).intValue() + this.scoreStuService.getTotalScore(memberInfoEntity.getId()));
|
|
|
@@ -349,6 +349,7 @@ public class MeetServiceImpl extends ServiceImpl<MeetMapper, MeetEntity> impleme
|
|
|
peopleEntity.setCreateTime(now);
|
|
|
peopleEntity.setUpdateTime(now);
|
|
|
peopleEntity.setIsDelete(IsDeleteEnum.NORMAL.value());
|
|
|
+ peopleEntity.setScoreRecordId(add.getId());
|
|
|
meetPeopleService.save(peopleEntity);
|
|
|
meetEntity.setProcess(MeetProcessEnum.RESERVE.value());
|
|
|
meetEntity.setMeetType(MeetTypeEnum.IN_A_GROUP.value());
|
|
|
@@ -377,6 +378,7 @@ public class MeetServiceImpl extends ServiceImpl<MeetMapper, MeetEntity> impleme
|
|
|
.selectOne(new LambdaQueryWrapper<MeetPeopleEntity>().eq(MeetPeopleEntity::getMeetId, meetId)
|
|
|
.orderByDesc(MeetPeopleEntity::getCreateTime).last("limit 1"));
|
|
|
if(ObjectUtil.isNotNull(meetPeopleEntity)) {
|
|
|
+ meetPeopleEntity.setScoreRecordId(add.getId());
|
|
|
meetPeopleEntity.setIsDelete(IsDeleteEnum.NORMAL.value());
|
|
|
meetPeopleService.save(meetPeopleEntity);
|
|
|
}
|
|
|
@@ -384,7 +386,10 @@ public class MeetServiceImpl extends ServiceImpl<MeetMapper, MeetEntity> impleme
|
|
|
meetEntity.setUpdateTime(now);
|
|
|
meetEntity.setIsDelete(IsDeleteEnum.NORMAL.value());
|
|
|
updateById(meetEntity);
|
|
|
- return new HashMap<>();
|
|
|
+ HashMap<String, String> resultMap = new HashMap<>();
|
|
|
+ resultMap.put("businessId", meetId.toString());
|
|
|
+ resultMap.put("type", "points");
|
|
|
+ return resultMap;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
@@ -584,16 +589,19 @@ public class MeetServiceImpl extends ServiceImpl<MeetMapper, MeetEntity> impleme
|
|
|
}
|
|
|
|
|
|
try {
|
|
|
- TaskConfigEnum meet = TaskConfigEnum.MEET;
|
|
|
- WxConsumeInfoEntity wxConsumeInfoEntity = wxConsumeInfoService.getByBusinessIdAndCode(meetId, meet.code());
|
|
|
- if (ObjectUtil.isNotNull(wxConsumeInfoEntity)) {
|
|
|
- String wxOrderNo = wxConsumeInfoEntity.getWxOrderNo();
|
|
|
- Map<String, String> value = orderService.wxPayRefund(openid, userId, meetId,
|
|
|
- OrderBusinessTypeEnum.REFUND.value(), meet.desc(), wxOrderNo, wxConsumeInfoEntity.getMoney());
|
|
|
- return R.ok().put("200", value);
|
|
|
- } else {
|
|
|
- return R.ok();
|
|
|
- }
|
|
|
+// TaskConfigEnum meet = TaskConfigEnum.MEET;
|
|
|
+// WxConsumeInfoEntity wxConsumeInfoEntity = wxConsumeInfoService.getByBusinessIdAndCode(meetId, meet.code());
|
|
|
+// if (ObjectUtil.isNotNull(wxConsumeInfoEntity)) {
|
|
|
+// String wxOrderNo = wxConsumeInfoEntity.getWxOrderNo();
|
|
|
+// Map<String, String> value = orderService.wxPayRefund(openid, userId, meetId,
|
|
|
+// OrderBusinessTypeEnum.REFUND.value(), meet.desc(), wxOrderNo, wxConsumeInfoEntity.getMoney());
|
|
|
+// return R.ok().put("200", value);
|
|
|
+// } else {
|
|
|
+// return R.ok();
|
|
|
+// }
|
|
|
+ //退还积分
|
|
|
+ refundScore(meetPeopleEntity);
|
|
|
+ return R.ok();
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
return R.error("微信退款异常!");
|
|
|
@@ -703,6 +711,26 @@ public class MeetServiceImpl extends ServiceImpl<MeetMapper, MeetEntity> impleme
|
|
|
return baseMapper.selectMyServiceStatistics(expertId, meetProcessList);
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public void refundScore(MeetPeopleEntity meetPeopleEntity) {
|
|
|
+ // 退款
|
|
|
+ ScoreStu scoreStu = scoreStuService.getById(meetPeopleEntity.getScoreRecordId());
|
|
|
+ //退还积分记录
|
|
|
+ if (scoreStu != null){
|
|
|
+ ScoreStu add = new ScoreStu();
|
|
|
+ add.setDay(DateForStr.getInfoDateStr(new Date()));
|
|
|
+ add.setStuId(meetPeopleEntity.getMemberId());
|
|
|
+ add.setScoreType(ScoreType.STORE_SCORE.getCode());
|
|
|
+ add.setTaskId(TaskType.MEET_CANCEL.getCode());
|
|
|
+ add.setBusinessId(meetPeopleEntity.getMeetId());
|
|
|
+ add.setScoreEvent(TaskType.MEET_CANCEL.getInfo());
|
|
|
+ add.setScoreValue(Math.abs(scoreStu.getScoreValue()));
|
|
|
+ add.setCreateTime(new Date());
|
|
|
+ add.setSurplusScore(Math.abs(scoreStu.getScoreValue())+ this.scoreStuService.getTotalScore(meetPeopleEntity.getMemberId()));
|
|
|
+ scoreStuMapper.insert(add);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
private void verifyMeetPeople(Long userId, Long expertId, Long topicId) {
|
|
|
ExpertEntity expertEntity = expertService.loadByMemberId(userId, false);
|
|
|
if (ObjectUtil.isNotNull(expertEntity)) {
|