Commit 5eddb67e by 王志超

fix: 合规负责人接口异常时走兜底

parent 62a9f2b6
Pipeline #92864 passed with stages
in 2 minutes 15 seconds
...@@ -228,10 +228,13 @@ public class InteriorChangeConfigServiceImpl implements InteriorChangeConfigServ ...@@ -228,10 +228,13 @@ public class InteriorChangeConfigServiceImpl implements InteriorChangeConfigServ
} }
} else if (ChangePrincipalEnum.COMPLIANCE.getName().equals(commander)) { } else if (ChangePrincipalEnum.COMPLIANCE.getName().equals(commander)) {
for (Long goods: goodsInfos) { for (Long goods: goodsInfos) {
try {
String detail = qcApiRpcService.getQaUserListByItemId(goods.intValue()); String detail = qcApiRpcService.getQaUserListByItemId(goods.intValue());
logger.info("[queryGoodsCommander] compliance:{}", detail); logger.info("[queryGoodsCommander] compliance:{}", detail);
JSONObject jsonObject = JSONObject.parseObject(detail); JSONObject jsonObject = JSONObject.parseObject(detail);
List<JSONObject> qaUserList = JSONObject.parseArray(jsonObject.getString("data"), JSONObject.class); if (jsonObject != null) {
List<JSONObject> qaUserList = JSONObject.parseArray(jsonObject.getString("data"),
JSONObject.class);
if (CollectionUtils.isNotEmpty(qaUserList)) { if (CollectionUtils.isNotEmpty(qaUserList)) {
for (JSONObject qaUser: qaUserList) { for (JSONObject qaUser: qaUserList) {
GoodsResponseRpc rpc = new GoodsResponseRpc(); GoodsResponseRpc rpc = new GoodsResponseRpc();
...@@ -241,6 +244,10 @@ public class InteriorChangeConfigServiceImpl implements InteriorChangeConfigServ ...@@ -241,6 +244,10 @@ public class InteriorChangeConfigServiceImpl implements InteriorChangeConfigServ
} }
} }
} }
} catch (Exception e) {
logger.error("[queryGoodsCommander] compliance error, itemId:{}", goods, e);
}
}
} }
//逻辑发生变更 //逻辑发生变更
/* /*
...@@ -405,10 +412,12 @@ public class InteriorChangeConfigServiceImpl implements InteriorChangeConfigServ ...@@ -405,10 +412,12 @@ public class InteriorChangeConfigServiceImpl implements InteriorChangeConfigServ
} }
//合规 //合规
for (Long itemId: itemIds) { for (Long itemId: itemIds) {
try {
String compliance = qcApiRpcService.getQaUserListByItemId(itemId.intValue()); String compliance = qcApiRpcService.getQaUserListByItemId(itemId.intValue());
logger.info("[queryGoodsPrincipalInfo] compliance:{}", compliance); logger.info("[queryGoodsPrincipalInfo] compliance:{}", compliance);
JSONObject jsonObject1 = JSONObject.parseObject(compliance); JSONObject jsonObject1 = JSONObject.parseObject(compliance);
List<JSONObject> qaUserList = JSONObject.parseArray(jsonObject1.getString("data"), JSONObject.class); List<JSONObject> qaUserList = jsonObject1 == null ? null
: JSONObject.parseArray(jsonObject1.getString("data"), JSONObject.class);
if (CollectionUtils.isNotEmpty(qaUserList)) { if (CollectionUtils.isNotEmpty(qaUserList)) {
JSONObject qaUser = qaUserList.get(0); JSONObject qaUser = qaUserList.get(0);
map.get(itemId).setGoodsComplianceName(qaUser.getString("userName")); map.get(itemId).setGoodsComplianceName(qaUser.getString("userName"));
...@@ -417,6 +426,10 @@ public class InteriorChangeConfigServiceImpl implements InteriorChangeConfigServ ...@@ -417,6 +426,10 @@ public class InteriorChangeConfigServiceImpl implements InteriorChangeConfigServ
} else { } else {
goodsRpc(ChangePrincipalEnum.COMPLIANCE.getType(), null, map.get(itemId)); goodsRpc(ChangePrincipalEnum.COMPLIANCE.getType(), null, map.get(itemId));
} }
} catch (Exception e) {
logger.error("[queryGoodsPrincipalInfo] compliance error, itemId:{}", itemId, e);
goodsRpc(ChangePrincipalEnum.COMPLIANCE.getType(), null, map.get(itemId));
}
} }
return map; return map;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment