|
@@ -87,13 +87,84 @@ public class GigThirdApiServiceImpl implements GigThirdApiService {
|
|
|
|
|
|
private final HuiqiyunInputRecordService huiqiyunInputRecordService;
|
|
private final HuiqiyunInputRecordService huiqiyunInputRecordService;
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 众蚁云结算回调业务处理
|
|
|
|
+ *
|
|
|
|
+ * @param bodyJson
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ @Override
|
|
|
|
+ public boolean zhongYiYunSettleNotify(JSONObject bodyJson) {
|
|
|
|
+ String reqId = bodyJson.getStr("reqId");
|
|
|
|
+ String state = bodyJson.getStr("state");
|
|
|
|
+
|
|
|
|
+ // 根据orderNo查询结算单
|
|
|
|
+ List<WmScorePackageSettleNote> settleNoteList = scorePackageSettleNoteService.list(Wrappers.<WmScorePackageSettleNote>lambdaQuery()
|
|
|
|
+ .eq(WmScorePackageSettleNote::getStreamId, reqId));
|
|
|
|
+ if (CollUtil.isEmpty(settleNoteList)) {
|
|
|
|
+ log.warn("订单reqId={}对应结算单不存在", reqId);
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ WmScorePackageSettleNote tmp = settleNoteList.get(0);
|
|
|
|
+
|
|
|
|
+ int yaoyiStatus = 0;
|
|
|
|
+ // state取值:
|
|
|
|
+ // SETSUCC结算成功;
|
|
|
|
+ // SETFAIL:结算失败;
|
|
|
|
+ // TICREF:已退票
|
|
|
|
+ if ("SETSUCC".equals(state)) {
|
|
|
|
+ // 对应要易结算成功状态
|
|
|
|
+ yaoyiStatus = 1;
|
|
|
|
+ } else if ("SETFAIL".equals(state)) {
|
|
|
|
+ yaoyiStatus = 2;
|
|
|
|
+ } else {
|
|
|
|
+ log.warn("当前结算state不处理");
|
|
|
|
+ redisTemplate.delete(CacheConstants.SETTLE_PACKAGE_KEY + tmp.getId());
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ // 修改结算状态
|
|
|
|
+ final int finalYaoyiStatus = yaoyiStatus;
|
|
|
|
+ List<WmScorePackageSettleNote> updateList = settleNoteList.stream().map(note -> {
|
|
|
|
+ WmScorePackageSettleNote updateEntity = new WmScorePackageSettleNote();
|
|
|
|
+ updateEntity.setId(note.getId());
|
|
|
|
+ updateEntity.setSettleNoteStatus(finalYaoyiStatus);
|
|
|
|
+ if (finalYaoyiStatus == 1){
|
|
|
|
+ updateEntity.setNotifyTime(LocalDateTime.now());
|
|
|
|
+ }
|
|
|
|
+ updateEntity.setUpdateTime(LocalDateTime.now());
|
|
|
|
+ return updateEntity;
|
|
|
|
+ }).collect(Collectors.toList());
|
|
|
|
+
|
|
|
|
+ scorePackageSettleNoteService.updateBatchById(updateList);
|
|
|
|
+
|
|
|
|
+ WmScorePackage scorePackage = scorePackageService.getById(tmp.getPackageId());
|
|
|
|
+
|
|
|
|
+ // 遥领不修改
|
|
|
|
+ if (!"1611890566".equals(scorePackage.getSendPackageDeptId())) {
|
|
|
|
+ // 更新积分包状态
|
|
|
|
+ log.info("更新积分包状态:{}", tmp);
|
|
|
|
+ WmScorePackage wmScorePackage = new WmScorePackage();
|
|
|
|
+ wmScorePackage.setId(tmp.getPackageId());
|
|
|
|
+ wmScorePackage.setSettleStatus(yaoyiStatus);
|
|
|
|
+ wmScorePackage.setUpdateTime(LocalDateTime.now());
|
|
|
|
+ scorePackageService.updateById(wmScorePackage);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ redisTemplate.delete(CacheConstants.SETTLE_PACKAGE_KEY + tmp.getId());
|
|
|
|
+
|
|
|
|
+ return true;
|
|
|
|
+ }
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 众蚁云签约回调业务处理
|
|
* 众蚁云签约回调业务处理
|
|
*
|
|
*
|
|
* @param newBodyJson
|
|
* @param newBodyJson
|
|
|
|
+ * @return
|
|
*/
|
|
*/
|
|
@Override
|
|
@Override
|
|
- public void zhongYiYunSignNotify(JSONObject newBodyJson) {
|
|
|
|
|
|
+ public boolean zhongYiYunSignNotify(JSONObject newBodyJson) {
|
|
|
|
|
|
String idCard = newBodyJson.getStr("idCard");
|
|
String idCard = newBodyJson.getStr("idCard");
|
|
String mobile = newBodyJson.getStr("mobile");
|
|
String mobile = newBodyJson.getStr("mobile");
|
|
@@ -109,7 +180,7 @@ public class GigThirdApiServiceImpl implements GigThirdApiService {
|
|
.eq(SysUser::getDelFlag, DelEnum.NOT_DEL.val()));
|
|
.eq(SysUser::getDelFlag, DelEnum.NOT_DEL.val()));
|
|
if (sysUser == null) {
|
|
if (sysUser == null) {
|
|
log.warn("用户不存在name={},idCard={},mobile={}", name, idCard, mobile);
|
|
log.warn("用户不存在name={},idCard={},mobile={}", name, idCard, mobile);
|
|
- return;
|
|
|
|
|
|
+ return false;
|
|
}
|
|
}
|
|
|
|
|
|
// 查询对应userSub数据
|
|
// 查询对应userSub数据
|
|
@@ -118,7 +189,7 @@ public class GigThirdApiServiceImpl implements GigThirdApiService {
|
|
.eq(SysUserSub::getSubjectLocation, SubjectLocation.ZHONG_YI_YUN));
|
|
.eq(SysUserSub::getSubjectLocation, SubjectLocation.ZHONG_YI_YUN));
|
|
if (userSub == null) {
|
|
if (userSub == null) {
|
|
log.warn("没有查到对应userSub数据 userId={}", sysUser.getUserId());
|
|
log.warn("没有查到对应userSub数据 userId={}", sysUser.getUserId());
|
|
- return;
|
|
|
|
|
|
+ return false;
|
|
}
|
|
}
|
|
|
|
|
|
// 更新userSub
|
|
// 更新userSub
|
|
@@ -133,6 +204,8 @@ public class GigThirdApiServiceImpl implements GigThirdApiService {
|
|
updateUserSub.setUpdateTime(LocalDateTime.now());
|
|
updateUserSub.setUpdateTime(LocalDateTime.now());
|
|
updateUserSub.setUpdateUser(0);
|
|
updateUserSub.setUpdateUser(0);
|
|
sysUserSubService.updateById(updateUserSub);
|
|
sysUserSubService.updateById(updateUserSub);
|
|
|
|
+
|
|
|
|
+ return true;
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|