销项合并测试:用户信息处理

beta-enc
dongxiaoke 2 years ago
parent cbe4e54a36
commit c8e7b787d5
  1. 52
      jianshui-invoice/src/main/java/com/jianshui/invoice/service/impl/api/JcskInvoiceApiServiceImpl.java

@ -1639,31 +1639,55 @@ public class JcskInvoiceApiServiceImpl implements IInvoiceApiService {
/** /**
* 用户信息处理 * 获取登记用户信息
*/ */
public InvoiceAllYhdj getUserInfo(Companyservice companyservice) { public InvoiceAllYhdj getUserInfo(Companyservice companyservice) {
String identity = companyservice.getIdentity(); String identity = companyservice.getIdentity();
String sellertax = companyservice.getSellertax(); String sellertax = companyservice.getSellertax();
String key = WebServiceConstant.TOKEN_KEY + sellertax + "_"+ identity;
RedisCache redisCache = SpringUtils.getBean(RedisCache.class); RedisCache redisCache = SpringUtils.getBean(RedisCache.class);
JSONObject yhdjObj = redisCache.getCacheObject(WebServiceConstant.TOKEN_KEY + sellertax + "_"+ identity); cn.hutool.json.JSONObject yhdjObj = redisCache.getCacheObject(key);
// TODO: 2023/5/17 if(JSONUtil.isNull(yhdjObj)){
// JSONObject obj = JSONObject.parseObject(info); // 查询用户登记参数
// Long exprieTime = System.currentTimeMillis(); QueryWrapper<InvoiceAllYhdj> yhdjQueryWrapper = new QueryWrapper<>();
// exprieTime = exprieTime + (int) obj.get("expires_in") * 1000L; // 过期时间 yhdjQueryWrapper.eq("nsrsbh", sellertax);
// obj.put("exprieTime", exprieTime); yhdjQueryWrapper.eq("identity", identity);
// redisCache.setCacheObject(ElephantConstants.TOKEN_REDIS_KEY + "appkey:" + appkey, obj); InvoiceAllYhdj invoiceAllYhdj = yhdjMapper.selectOne(yhdjQueryWrapper);
// 查询用户登记参数 cn.hutool.json.JSONObject obj = JSONUtil.parseObj(invoiceAllYhdj);
QueryWrapper<InvoiceAllYhdj> yhdjQueryWrapper = new QueryWrapper<>(); Long exprieTime = System.currentTimeMillis(); // 过期时间
yhdjQueryWrapper.eq("nsrsbh", sellertax); obj.put("exprieTime", exprieTime);
yhdjQueryWrapper.eq("identity", identity); redisCache.setCacheObject(key, obj);
InvoiceAllYhdj invoiceAllYhdj = yhdjMapper.selectOne(yhdjQueryWrapper);
yhdjObj = obj;
}
return invoiceAllYhdj; return BeanUtil.copyProperties(yhdjObj,InvoiceAllYhdj.class);
} }
} }

Loading…
Cancel
Save