|
@@ -2,6 +2,7 @@ package com.qunzhixinxi.hnqz.admin.service.gig.impl;
|
|
|
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
+import com.qunzhixinxi.hnqz.admin.api.constant.CacheConstants;
|
|
|
import com.qunzhixinxi.hnqz.admin.api.dto.OladingCommonRequest;
|
|
|
import com.qunzhixinxi.hnqz.admin.entity.SysUserSub;
|
|
|
import com.qunzhixinxi.hnqz.admin.entity.dto.UserSignCertDTO;
|
|
@@ -14,12 +15,15 @@ import com.qunzhixinxi.hnqz.admin.service.gig.SysUserSignCertService;
|
|
|
import com.qunzhixinxi.hnqz.common.core.exception.ValidateCodeException;
|
|
|
import lombok.AllArgsConstructor;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.springframework.data.redis.core.RedisTemplate;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
import java.time.LocalDateTime;
|
|
|
import java.util.Collections;
|
|
|
+import java.util.HashMap;
|
|
|
import java.util.Map;
|
|
|
+import java.util.concurrent.TimeUnit;
|
|
|
|
|
|
/**
|
|
|
* @author lixuesong
|
|
@@ -34,6 +38,8 @@ public class GigThirdApiServiceImpl implements GigThirdApiService {
|
|
|
|
|
|
private final SysUserSignCertService sysUserSignCertService;
|
|
|
|
|
|
+ private final RedisTemplate redisTemplate;
|
|
|
+
|
|
|
/**
|
|
|
* 自由职家回调业务处理
|
|
|
* @param interfaceName
|
|
@@ -95,6 +101,7 @@ public class GigThirdApiServiceImpl implements GigThirdApiService {
|
|
|
throw new ValidateCodeException("requestId不存在");
|
|
|
}
|
|
|
|
|
|
+ Map<String, String> subMap = new HashMap<>();
|
|
|
if (OladingCommonRequest.SignUpStatus.SIGN.equals(signUpCertStatus)) {
|
|
|
// 更新状态
|
|
|
SysUserSub updateUserSub = new SysUserSub();
|
|
@@ -109,7 +116,16 @@ public class GigThirdApiServiceImpl implements GigThirdApiService {
|
|
|
userSignCertDTO.setUserId(userSub.getUserId());
|
|
|
userSignCertDTO.setGigTypeList(Collections.singletonList(GigTypeEnum.OLADING));
|
|
|
sysUserSignCertService.batchChannelCert(userSignCertDTO);
|
|
|
+ subMap.put("certStatus", OladingCertStatus.SIGNED.name());
|
|
|
+ } else {
|
|
|
+ subMap.put("certStatus", OladingCertStatus.UN_SIGNED.name());
|
|
|
}
|
|
|
+
|
|
|
+ // 结果放到redis
|
|
|
+ String key = CacheConstants.USER_SIGN_CERT_RESPONSE_KEY + userSub.getUserId();
|
|
|
+ Map<String, Object> result = new HashMap<>();
|
|
|
+ result.put("OLADING", subMap);
|
|
|
+ redisTemplate.opsForValue().set(key, result, 1, TimeUnit.MINUTES);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -128,6 +144,7 @@ public class GigThirdApiServiceImpl implements GigThirdApiService {
|
|
|
throw new ValidateCodeException("requestId不存在");
|
|
|
}
|
|
|
|
|
|
+ Map<String, String> subMap = new HashMap<>();
|
|
|
if (OladingCommonRequest.UploadIdCardImageStatus.IDENTIFY_SUCCESS.equals(uploadIdCertStatus)) {
|
|
|
// 如果成功,则发送协议上传MQ
|
|
|
log.info("=============================发送协议上传MQ==================================");
|
|
@@ -135,7 +152,16 @@ public class GigThirdApiServiceImpl implements GigThirdApiService {
|
|
|
userSignCertDTO.setUserId(userSub.getUserId());
|
|
|
userSignCertDTO.setGigTypeList(Collections.singletonList(GigTypeEnum.OLADING));
|
|
|
sysUserSignCertService.batchChannelCert(userSignCertDTO);
|
|
|
+ subMap.put("certStatus", OladingCertStatus.SIGNED.name());
|
|
|
+ } else {
|
|
|
+ subMap.put("certStatus", OladingCertStatus.SIGNED.name());
|
|
|
}
|
|
|
+
|
|
|
+ // 结果放到redis
|
|
|
+ String key = CacheConstants.USER_SIGN_CERT_RESPONSE_KEY + userSub.getUserId();
|
|
|
+ Map<String, Object> result = new HashMap<>();
|
|
|
+ result.put("OLADING", subMap);
|
|
|
+ redisTemplate.opsForValue().set(key, result, 1, TimeUnit.MINUTES);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -154,6 +180,7 @@ public class GigThirdApiServiceImpl implements GigThirdApiService {
|
|
|
throw new ValidateCodeException("requestId不存在");
|
|
|
}
|
|
|
|
|
|
+ Map<String, String> subMap = new HashMap<>();
|
|
|
if (OladingCommonRequest.UploadTaxpayerAgreementStatus.SUCCESS.equals(agreementStatus)) {
|
|
|
// 更新状态
|
|
|
SysUserSub updateUserSub = new SysUserSub();
|
|
@@ -163,6 +190,15 @@ public class GigThirdApiServiceImpl implements GigThirdApiService {
|
|
|
updateUserSub.setUpdateTime(LocalDateTime.now());
|
|
|
updateUserSub.setUpdateUser(0);
|
|
|
sysUserSubService.updateById(updateUserSub);
|
|
|
+ subMap.put("certStatus", OladingCertStatus.CERT.name());
|
|
|
+ } else {
|
|
|
+ subMap.put("certStatus", OladingCertStatus.SIGNED.name());
|
|
|
}
|
|
|
+
|
|
|
+ // 结果放到redis
|
|
|
+ String key = CacheConstants.USER_SIGN_CERT_RESPONSE_KEY + userSub.getUserId();
|
|
|
+ Map<String, Object> result = new HashMap<>();
|
|
|
+ result.put("OLADING", subMap);
|
|
|
+ redisTemplate.opsForValue().set(key, result, 1, TimeUnit.MINUTES);
|
|
|
}
|
|
|
}
|