Commit 5eddb67e by 王志超

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

parent 62a9f2b6
Pipeline #92864 passed with stages
in 2 minutes 15 seconds
...@@ -228,17 +228,24 @@ public class InteriorChangeConfigServiceImpl implements InteriorChangeConfigServ ...@@ -228,17 +228,24 @@ 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) {
String detail = qcApiRpcService.getQaUserListByItemId(goods.intValue()); try {
logger.info("[queryGoodsCommander] compliance:{}", detail); String detail = qcApiRpcService.getQaUserListByItemId(goods.intValue());
JSONObject jsonObject = JSONObject.parseObject(detail); logger.info("[queryGoodsCommander] compliance:{}", detail);
List<JSONObject> qaUserList = JSONObject.parseArray(jsonObject.getString("data"), JSONObject.class); JSONObject jsonObject = JSONObject.parseObject(detail);
if (CollectionUtils.isNotEmpty(qaUserList)) { if (jsonObject != null) {
for (JSONObject qaUser: qaUserList) { List<JSONObject> qaUserList = JSONObject.parseArray(jsonObject.getString("data"),
GoodsResponseRpc rpc = new GoodsResponseRpc(); JSONObject.class);
rpc.setEmail(qaUser.getString("uid")); if (CollectionUtils.isNotEmpty(qaUserList)) {
rpc.setName(qaUser.getString("userName")); for (JSONObject qaUser: qaUserList) {
emails.add(rpc); GoodsResponseRpc rpc = new GoodsResponseRpc();
rpc.setEmail(qaUser.getString("uid"));
rpc.setName(qaUser.getString("userName"));
emails.add(rpc);
}
}
} }
} catch (Exception e) {
logger.error("[queryGoodsCommander] compliance error, itemId:{}", goods, e);
} }
} }
} }
...@@ -405,16 +412,22 @@ public class InteriorChangeConfigServiceImpl implements InteriorChangeConfigServ ...@@ -405,16 +412,22 @@ public class InteriorChangeConfigServiceImpl implements InteriorChangeConfigServ
} }
//合规 //合规
for (Long itemId: itemIds) { for (Long itemId: itemIds) {
String compliance = qcApiRpcService.getQaUserListByItemId(itemId.intValue()); try {
logger.info("[queryGoodsPrincipalInfo] compliance:{}", compliance); String compliance = qcApiRpcService.getQaUserListByItemId(itemId.intValue());
JSONObject jsonObject1 = JSONObject.parseObject(compliance); logger.info("[queryGoodsPrincipalInfo] compliance:{}", compliance);
List<JSONObject> qaUserList = JSONObject.parseArray(jsonObject1.getString("data"), JSONObject.class); JSONObject jsonObject1 = JSONObject.parseObject(compliance);
if (CollectionUtils.isNotEmpty(qaUserList)) { List<JSONObject> qaUserList = jsonObject1 == null ? null
JSONObject qaUser = qaUserList.get(0); : JSONObject.parseArray(jsonObject1.getString("data"), JSONObject.class);
map.get(itemId).setGoodsComplianceName(qaUser.getString("userName")); if (CollectionUtils.isNotEmpty(qaUserList)) {
map.get(itemId).setGoodsComplianceEmail(qaUser.getString("uid")); JSONObject qaUser = qaUserList.get(0);
goodsRpc(ChangePrincipalEnum.COMPLIANCE.getType(), qaUser.getString("uid"), map.get(itemId)); map.get(itemId).setGoodsComplianceName(qaUser.getString("userName"));
} else { map.get(itemId).setGoodsComplianceEmail(qaUser.getString("uid"));
goodsRpc(ChangePrincipalEnum.COMPLIANCE.getType(), qaUser.getString("uid"), map.get(itemId));
} else {
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)); goodsRpc(ChangePrincipalEnum.COMPLIANCE.getType(), null, map.get(itemId));
} }
} }
......
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