开票绑定 多余参数 删除

This commit is contained in:
wangw 2024-11-25 16:10:38 +08:00
parent a59f6c2568
commit 4fb6310c9c
1 changed files with 6 additions and 4 deletions

View File

@ -47,15 +47,17 @@ public class BindServiceImpl implements BindService {
@Override
public JSONObject subInvoicing(Map<String, Object> params) {
String shopId = params.get("shopId").toString();
params.remove("shopId");
String result = HttpUtil.post(url + "cash/subinvoicing", params, 5000);
JSONObject jsonObject = JSONObject.parseObject(result);
if (jsonObject.getInteger("code").equals(1)) {
if (params.get("shopId") != null) {
if (redisUtils.hasKey(CacheKey.INVOICE_SD_TYPE + params.get("shopId"))) {
Set<Object> articles = redisUtils.sGet(CacheKey.INVOICE_SD_TYPE + params.get("shopId"));
if (StringUtils.isNotBlank(shopId)) {
if (redisUtils.hasKey(CacheKey.INVOICE_SD_TYPE + shopId)) {
Set<Object> articles = redisUtils.sGet(CacheKey.INVOICE_SD_TYPE + shopId);
if (!articles.contains(params.get("article"))) {
articles.add(params.get("article"));
redisUtils.sSet(CacheKey.INVOICE_SD_TYPE + params.get("shopId"), articles);
redisUtils.sSet(CacheKey.INVOICE_SD_TYPE + shopId, articles);
}
}
}