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

beta-enc
dongxiaoke 2 years ago
parent cbe4e54a36
commit c8e7b787d5
  1. 44
      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) {
String identity = companyservice.getIdentity();
String sellertax = companyservice.getSellertax();
RedisCache redisCache = SpringUtils.getBean(RedisCache.class);
JSONObject yhdjObj = redisCache.getCacheObject(WebServiceConstant.TOKEN_KEY + sellertax + "_"+ identity);
String key = WebServiceConstant.TOKEN_KEY + sellertax + "_"+ identity;
// TODO: 2023/5/17
// JSONObject obj = JSONObject.parseObject(info);
// Long exprieTime = System.currentTimeMillis();
// exprieTime = exprieTime + (int) obj.get("expires_in") * 1000L; // 过期时间
// obj.put("exprieTime", exprieTime);
// redisCache.setCacheObject(ElephantConstants.TOKEN_REDIS_KEY + "appkey:" + appkey, obj);
RedisCache redisCache = SpringUtils.getBean(RedisCache.class);
cn.hutool.json.JSONObject yhdjObj = redisCache.getCacheObject(key);
if(JSONUtil.isNull(yhdjObj)){
// 查询用户登记参数
QueryWrapper<InvoiceAllYhdj> yhdjQueryWrapper = new QueryWrapper<>();
yhdjQueryWrapper.eq("nsrsbh", sellertax);
yhdjQueryWrapper.eq("identity", identity);
InvoiceAllYhdj invoiceAllYhdj = yhdjMapper.selectOne(yhdjQueryWrapper);
return invoiceAllYhdj;
cn.hutool.json.JSONObject obj = JSONUtil.parseObj(invoiceAllYhdj);
Long exprieTime = System.currentTimeMillis(); // 过期时间
obj.put("exprieTime", exprieTime);
redisCache.setCacheObject(key, obj);
yhdjObj = obj;
}
return BeanUtil.copyProperties(yhdjObj,InvoiceAllYhdj.class);
}
}

Loading…
Cancel
Save