|
|
@@ -463,84 +463,29 @@ public class SmsbAppointmentInfoServiceImpl implements ISmsbAppointmentInfoServi
|
|
|
}
|
|
|
List<String> result = new ArrayList<>();
|
|
|
// 1-获取reportMap的数据。
|
|
|
- result.add("诊断等级:" + reportMapJson.get("rateName"));
|
|
|
- result.add("评估名称:" + reportMapJson.get("estimateName"));
|
|
|
- result.add("测评名称:" + reportMapJson.get("evaluationName"));
|
|
|
result.add("企业名称:" + reportMapJson.get("organizeName"));
|
|
|
result.add("企业地市:" + reportMapJson.get("organizeZone"));
|
|
|
- result.add("报告时间:" + reportMapJson.get("commitTime"));
|
|
|
- result.add("测评得分:" + reportMapJson.get("totalScore"));
|
|
|
// 2-读取报告具体内容
|
|
|
JSONObject reportContent = reportMapJson.getJSONObject("reportContent");
|
|
|
- // 2-1 评分标准:
|
|
|
- JSONArray standards = reportContent.getJSONArray("standards");
|
|
|
- if (null != standards && standards.size() > 0) {
|
|
|
- StringBuilder standardResult = new StringBuilder();
|
|
|
- standardResult.append("评分标准:\n");
|
|
|
- for (int i = 0; i < standards.size(); i++) {
|
|
|
-
|
|
|
- standardResult.append("等级名称:").append(standards.getJSONObject(i).getStr("levelName")).append("\n");
|
|
|
- standardResult.append("等级描述:").append(standards.getJSONObject(i).get("levelDesc")).append("\n");
|
|
|
- standardResult.append("最小分值:").append(standards.getJSONObject(i).get("minScore")).append("\n");
|
|
|
- standardResult.append("最大分值:").append(standards.getJSONObject(i).get("maxScore")).append("\n");
|
|
|
- }
|
|
|
- result.add(standardResult.toString());
|
|
|
- }
|
|
|
- // 2-2 当前分值
|
|
|
- result.add("当前分值:" + reportContent.get("score"));
|
|
|
- // 2-3 对标情况
|
|
|
- JSONObject benchmarking = reportContent.getJSONObject("benchmarking");
|
|
|
- // 2-3-1 等级情况
|
|
|
- JSONArray rate = benchmarking.getJSONArray("rate");
|
|
|
- if (null != rate && rate.size() > 0) {
|
|
|
- StringBuilder rateResult = new StringBuilder();
|
|
|
- for (int i = 0; i < rate.size(); i++) {
|
|
|
- rateResult.append("等级情况:\n");
|
|
|
- rateResult.append("等级名称:").append(rate.getJSONObject(i).getStr("rate")).append("\n");
|
|
|
- rateResult.append("等级数量:").append(rate.getJSONObject(i).get("quantity")).append("\n");
|
|
|
- rateResult.append("平均分值:").append(rate.getJSONObject(i).get("avg")).append("\n");
|
|
|
+ result.add("诊断结果:诊断得分为" + reportContent.get("score") + ",诊断等级为" + reportMapJson.get("rateName"));
|
|
|
+ StringBuilder builder = new StringBuilder("诊断详情/具体情况/展开分析:");
|
|
|
+ JSONArray situation = reportContent.getJSONArray("situation");
|
|
|
+ if (situation != null) {
|
|
|
+ situation.forEach(item -> {
|
|
|
+ JSONObject situationItem = JSONUtil.parseObj(item);
|
|
|
+ builder.append(situationItem.getStr("className")).append("方面得分为")
|
|
|
+ .append(situationItem.getStr("actualScore")).append(";");
|
|
|
+ StringBuilder stringBuilder = new StringBuilder(situationItem.getStr("className"));
|
|
|
+ stringBuilder.append("方面具体情况:");
|
|
|
+ situationItem.getJSONArray("children").forEach(childItem -> {
|
|
|
+ JSONObject children = JSONUtil.parseObj(childItem);
|
|
|
+ stringBuilder.append(children.getStr("className")).append("得分为")
|
|
|
+ .append(children.getStr("actualScore")).append(",");
|
|
|
+ });
|
|
|
+ result.add(stringBuilder.toString());
|
|
|
+ });
|
|
|
}
|
|
|
- result.add(rateResult.toString());
|
|
|
- }
|
|
|
- // 2-3-2 得分情况
|
|
|
- JSONObject location = benchmarking.getJSONObject("location");
|
|
|
- if (null != location) {
|
|
|
- StringBuilder locationResult = new StringBuilder();
|
|
|
- locationResult.append("得分情况:\n");
|
|
|
- locationResult.append("自评高于贵公司的数量:").append(location.get("current")).append("\n");
|
|
|
- locationResult.append("自评等于贵公司的数量:").append(location.get("equalCount")).append("\n");
|
|
|
- locationResult.append("总数量:").append(location.get("count")).append("\n");
|
|
|
- result.add(locationResult.toString());
|
|
|
- }
|
|
|
- // 2-4 分析建议
|
|
|
- JSONObject suggestion = reportContent.getJSONObject("suggestion");
|
|
|
- // 2-4-1 劣势列表
|
|
|
- JSONArray disadvantage = suggestion.getJSONArray("disadvantage");
|
|
|
- if (null != disadvantage && disadvantage.size() > 0){
|
|
|
- StringBuilder disadvantageResult = new StringBuilder();
|
|
|
- for (int i = 0; i < disadvantage.size(); i++) {
|
|
|
- disadvantageResult.append("劣势列表:\n");
|
|
|
- disadvantageResult.append(disadvantage.get(i)).append("\n");
|
|
|
- }
|
|
|
- result.add(disadvantageResult.toString());
|
|
|
- }
|
|
|
- // 2-4-2 优势列表
|
|
|
- JSONArray advantage = suggestion.getJSONArray("advantage");
|
|
|
- if (null != advantage && advantage.size() > 0) {
|
|
|
- StringBuilder advantageResult = new StringBuilder();
|
|
|
- for (int i = 0; i < advantage.size(); i++) {
|
|
|
- advantageResult.append("优势列表:\n");
|
|
|
- advantageResult.append(advantage.get(i)).append("\n");
|
|
|
- }
|
|
|
- result.add(advantageResult.toString());
|
|
|
- }
|
|
|
- // 2-4-3 相关建议列表
|
|
|
- JSONObject content = suggestion.getJSONObject("content");
|
|
|
- result.add("相关建议:" + content.toString()
|
|
|
- .replaceAll("\\{", "").replaceAll("}", "")
|
|
|
- .replaceAll("\\[", "").replaceAll("]", "").trim());
|
|
|
- // 2-5 满分
|
|
|
- result.add("满分:" + reportContent.get("fullScore"));
|
|
|
+ result.add(builder.toString());
|
|
|
return result;
|
|
|
} catch (Exception e) {
|
|
|
log.error("获取评估报告内容失败", e);
|
|
|
@@ -558,6 +503,8 @@ public class SmsbAppointmentInfoServiceImpl implements ISmsbAppointmentInfoServi
|
|
|
requestBody.add("secret", secret);
|
|
|
JsonObject body = new JsonObject();
|
|
|
body.add("phoneNumber", add.getPhone());
|
|
|
+// // 报告模版
|
|
|
+// body.add("evaluationId", "1838819686746316801");
|
|
|
requestBody.add("body", body.toString());
|
|
|
HttpRequest request = HttpRequest.post(scApiBaseUrl)
|
|
|
.header("Content-Type", "application/json")
|