|
@@ -148,111 +148,118 @@ public class ClinicSatisfiedService {
|
|
|
result.setTotalUnsatisfiedPercentage(makePercentage(result.getTotalUnsatisfiedCount(),result.getTotalAssessmentsCount()));
|
|
|
int totalOptionCount = 0;
|
|
|
int totalUnsatisfiedOptionCount = 0;
|
|
|
- int yjkTotalCount = 0;
|
|
|
+ int yjkAssessmentCount = 0;
|
|
|
int yjkUnsatisfiedCount = 0;
|
|
|
- int fskTotalCount = 0;
|
|
|
+ int fskAssessmentCount = 0;
|
|
|
int fskUnsatisfiedCount = 0;
|
|
|
- int csyxkTotalCount = 0;
|
|
|
+ int csyxkAssessmentCount = 0;
|
|
|
int csyxkUnsatisfiedCount = 0;
|
|
|
- int jykTotalCount = 0;
|
|
|
+ int jykAssessmentCount = 0;
|
|
|
int jykUnsatisfiedCount = 0;
|
|
|
- int sfckTotalCount = 0;
|
|
|
+ int sfckAssessmentCount = 0;
|
|
|
int sfckUnsatisfiedCount = 0;
|
|
|
- int mzyhTotalCount = 0;
|
|
|
+ int mzyhAssessmentCount = 0;
|
|
|
int mzyhUnsatisfiedCount = 0;
|
|
|
- int jzyhTotalCount = 0;
|
|
|
+ int jzyhAssessmentCount = 0;
|
|
|
int jzyhUnsatisfiedCount = 0;
|
|
|
|
|
|
- int yjkOptionsCount = 0;
|
|
|
+ int yjkCheckedOptionsCount = 0;
|
|
|
JSONObject yjkOptionsJson = JSONObject.parseObject("{\"A\": 0,\"B\": 0,\"C\": 0,\"D\": 0,\"E\": 0,\"F\": 0,\"G\": 0}");
|
|
|
|
|
|
- int fskOptionsCount = 0;
|
|
|
+ int fskCheckedOptionsCount = 0;
|
|
|
JSONObject fskOptionsJson = JSONObject.parseObject("{\"A\": 0,\"B\": 0,\"C\": 0,\"D\": 0,\"E\": 0,\"F\": 0,\"G\": 0}");
|
|
|
|
|
|
- int csyxkOptionsCount = 0;
|
|
|
+ int csyxkCheckedOptionsCount = 0;
|
|
|
JSONObject csyxkOptionsJson = JSONObject.parseObject("{\"A\": 0,\"B\": 0,\"C\": 0,\"D\": 0,\"E\": 0,\"F\": 0,\"G\": 0}");
|
|
|
|
|
|
- int jykOptionsCount = 0;
|
|
|
+ int jykCheckedOptionsCount = 0;
|
|
|
JSONObject jykOptionsJson = JSONObject.parseObject("{\"A\": 0,\"B\": 0,\"C\": 0,\"D\": 0,\"E\": 0,\"F\": 0,\"G\": 0}");
|
|
|
|
|
|
- int sfckOptionsCount = 0;
|
|
|
+ int sfckCheckedOptionsCount = 0;
|
|
|
JSONObject sfckOptionsJson = JSONObject.parseObject("{\"A\": 0,\"B\": 0,\"C\": 0,\"D\": 0,\"E\": 0,\"F\": 0,\"G\": 0}");
|
|
|
|
|
|
// options2 item11,12
|
|
|
- int mzyhOptionsCount = 0;
|
|
|
+ int mzyhCheckedOptionsCount = 0;
|
|
|
JSONObject mzyhOptionsJson = JSONObject.parseObject("{\"A\": 0,\"B\": 0,\"C\": 0,\"D\": 0,\"E\": 0,\"F\": 0}");
|
|
|
|
|
|
- int jzyhOptionsCount = 0;
|
|
|
+ int jzyhCheckedOptionsCount = 0;
|
|
|
JSONObject jzyhOptionsJson = JSONObject.parseObject("{\"A\": 0,\"B\": 0,\"C\": 0,\"D\": 0,\"E\": 0,\"F\": 0,\"G\": 0}");
|
|
|
|
|
|
for (ClinicSatisfiedBody body : list) {
|
|
|
if (StringUtil.notBlank(body.getItem1()) && !body.getItem1().equals("C")) {
|
|
|
totalOptionCount += 1;
|
|
|
- yjkTotalCount += 1;
|
|
|
+ yjkAssessmentCount += 1;
|
|
|
}
|
|
|
if (Objects.equals("B", body.getItem1())) {
|
|
|
yjkUnsatisfiedCount += 1;
|
|
|
totalUnsatisfiedOptionCount += 1;
|
|
|
- yjkOptionsCount = getOptionsCount(yjkOptionsCount, yjkOptionsJson, body.getItem2());
|
|
|
+ yjkCheckedOptionsCount = getCheckedOptionsCount(yjkCheckedOptionsCount, yjkOptionsJson, body.getItem2());
|
|
|
}
|
|
|
if (StringUtil.notBlank(body.getItem3()) && !body.getItem3().equals("C")) {
|
|
|
totalOptionCount += 1;
|
|
|
- fskTotalCount += 1;
|
|
|
+ fskAssessmentCount += 1;
|
|
|
}
|
|
|
if (Objects.equals("B", body.getItem3())) {
|
|
|
fskUnsatisfiedCount += 1;
|
|
|
totalUnsatisfiedOptionCount += 1;
|
|
|
- fskOptionsCount = getOptionsCount(fskOptionsCount, fskOptionsJson, body.getItem4());
|
|
|
+ fskCheckedOptionsCount = getCheckedOptionsCount(fskCheckedOptionsCount, fskOptionsJson, body.getItem4());
|
|
|
}
|
|
|
if (StringUtil.notBlank(body.getItem5()) && !body.getItem5().equals("C")) {
|
|
|
totalOptionCount += 1;
|
|
|
- csyxkTotalCount += 1;
|
|
|
+ csyxkAssessmentCount += 1;
|
|
|
}
|
|
|
if (Objects.equals("B", body.getItem5())) {
|
|
|
csyxkUnsatisfiedCount += 1;
|
|
|
totalUnsatisfiedOptionCount += 1;
|
|
|
- csyxkOptionsCount = getOptionsCount(csyxkOptionsCount, csyxkOptionsJson, body.getItem6());
|
|
|
+ csyxkCheckedOptionsCount = getCheckedOptionsCount(csyxkCheckedOptionsCount, csyxkOptionsJson, body.getItem6());
|
|
|
}
|
|
|
if (StringUtil.notBlank(body.getItem7()) && !body.getItem7().equals("C")) {
|
|
|
totalOptionCount += 1;
|
|
|
- jykTotalCount += 1;
|
|
|
+ jykAssessmentCount += 1;
|
|
|
}
|
|
|
if (Objects.equals("B", body.getItem7())) {
|
|
|
jykUnsatisfiedCount += 1;
|
|
|
totalUnsatisfiedOptionCount += 1;
|
|
|
- jykOptionsCount = getOptionsCount(jykOptionsCount, jykOptionsJson, body.getItem8());
|
|
|
+ jykCheckedOptionsCount = getCheckedOptionsCount(jykCheckedOptionsCount, jykOptionsJson, body.getItem8());
|
|
|
}
|
|
|
if (StringUtil.notBlank(body.getItem9()) && !body.getItem9().equals("C")) {
|
|
|
totalOptionCount += 1;
|
|
|
- sfckTotalCount += 1;
|
|
|
+ sfckAssessmentCount += 1;
|
|
|
}
|
|
|
if (Objects.equals("B", body.getItem9())) {
|
|
|
sfckUnsatisfiedCount += 1;
|
|
|
totalUnsatisfiedOptionCount += 1;
|
|
|
- sfckOptionsCount = getOptionsCount(sfckOptionsCount, sfckOptionsJson, body.getItem10());
|
|
|
+ sfckCheckedOptionsCount = getCheckedOptionsCount(sfckCheckedOptionsCount, sfckOptionsJson, body.getItem10());
|
|
|
}
|
|
|
if (StringUtil.notBlank(body.getItem11()) && !body.getItem11().equals("C")) {
|
|
|
totalOptionCount += 1;
|
|
|
- mzyhTotalCount += 1;
|
|
|
+ mzyhAssessmentCount += 1;
|
|
|
}
|
|
|
if (Objects.equals("B", body.getItem11())) {
|
|
|
mzyhUnsatisfiedCount += 1;
|
|
|
totalUnsatisfiedOptionCount += 1;
|
|
|
- mzyhOptionsCount = getOptionsCount(mzyhOptionsCount, mzyhOptionsJson, body.getItem12());
|
|
|
+ mzyhCheckedOptionsCount = getCheckedOptionsCount(mzyhCheckedOptionsCount, mzyhOptionsJson, body.getItem12());
|
|
|
}
|
|
|
if (StringUtil.notBlank(body.getItem13()) && !body.getItem13().equals("C")) {
|
|
|
totalOptionCount += 1;
|
|
|
- jzyhTotalCount += 1;
|
|
|
+ jzyhAssessmentCount += 1;
|
|
|
}
|
|
|
if (Objects.equals("B", body.getItem13())) {
|
|
|
jzyhUnsatisfiedCount += 1;
|
|
|
totalUnsatisfiedOptionCount += 1;
|
|
|
- jzyhOptionsCount = getOptionsCount(jzyhOptionsCount, jzyhOptionsJson, body.getItem14());
|
|
|
+ jzyhCheckedOptionsCount = getCheckedOptionsCount(jzyhCheckedOptionsCount, jzyhOptionsJson, body.getItem14());
|
|
|
}
|
|
|
}
|
|
|
result.setTotalOptionCount(totalOptionCount);
|
|
|
result.setTotalUnsatisfiedOptionCount(totalUnsatisfiedOptionCount);
|
|
|
result.setTotalUnsatisfiedOptionPercentage(makePercentage(totalUnsatisfiedOptionCount, totalOptionCount));
|
|
|
+ result.setYjkAssessmentCount(yjkAssessmentCount);
|
|
|
+ result.setFskAssessmentCount(fskAssessmentCount);
|
|
|
+ result.setCsyxkAssessmentCount(csyxkAssessmentCount);
|
|
|
+ result.setJykAssessmentCount(jykAssessmentCount);
|
|
|
+ result.setSfckAssessmentCount(sfckAssessmentCount);
|
|
|
+ result.setMzyhAssessmentCount(mzyhAssessmentCount);
|
|
|
+ result.setJzyhAssessmentCount(jzyhAssessmentCount);
|
|
|
result.setYjkUnsatisfiedCount(yjkUnsatisfiedCount);
|
|
|
result.setFskUnsatisfiedCount(fskUnsatisfiedCount);
|
|
|
result.setCsyxkUnsatisfiedCount(csyxkUnsatisfiedCount);
|
|
@@ -260,55 +267,58 @@ public class ClinicSatisfiedService {
|
|
|
result.setSfckUnsatisfiedCount(sfckUnsatisfiedCount);
|
|
|
result.setMzyhUnsatisfiedCount(mzyhUnsatisfiedCount);
|
|
|
result.setJzyhUnsatisfiedCount(jzyhUnsatisfiedCount);
|
|
|
- result.setYjkUnsatisfiedPercentage(makePercentage(yjkUnsatisfiedCount, yjkTotalCount));
|
|
|
- result.setFskUnsatisfiedPercentage(makePercentage(fskUnsatisfiedCount, fskTotalCount));
|
|
|
- result.setCsyxkUnsatisfiedPercentage(makePercentage(csyxkUnsatisfiedCount, csyxkTotalCount));
|
|
|
- result.setJykUnsatisfiedPercentage(makePercentage(jykUnsatisfiedCount, jykTotalCount));
|
|
|
- result.setSfckUnsatisfiedPercentage(makePercentage(sfckUnsatisfiedCount, sfckTotalCount));
|
|
|
- result.setMzyhUnsatisfiedPercentage(makePercentage(mzyhUnsatisfiedCount, mzyhTotalCount));
|
|
|
- result.setJzyhUnsatisfiedPercentage(makePercentage(jzyhUnsatisfiedCount, jzyhTotalCount));
|
|
|
-
|
|
|
- result.setYjkUnsatisfiedOption(fillOptionDetails(yjkOptionsCount, yjkOptionsJson, false));
|
|
|
- result.setFskUnsatisfiedOption(fillOptionDetails(fskOptionsCount, fskOptionsJson, false));
|
|
|
- result.setCsyxkUnsatisfiedOption(fillOptionDetails(csyxkOptionsCount, csyxkOptionsJson, false));
|
|
|
- result.setJykUnsatisfiedOption(fillOptionDetails(jykOptionsCount, jykOptionsJson, false));
|
|
|
- result.setSfckUnsatisfiedOption(fillOptionDetails(sfckOptionsCount, sfckOptionsJson, false));
|
|
|
- result.setMzyhUnsatisfiedOption(fillOptionDetails(mzyhOptionsCount, mzyhOptionsJson, true));
|
|
|
- result.setJzyhUnsatisfiedOption(fillOptionDetails(jzyhOptionsCount, jzyhOptionsJson, false));
|
|
|
+ result.setYjkUnsatisfiedPercentage(makePercentage(yjkUnsatisfiedCount, yjkAssessmentCount));
|
|
|
+ result.setFskUnsatisfiedPercentage(makePercentage(fskUnsatisfiedCount, fskAssessmentCount));
|
|
|
+ result.setCsyxkUnsatisfiedPercentage(makePercentage(csyxkUnsatisfiedCount, csyxkAssessmentCount));
|
|
|
+ result.setJykUnsatisfiedPercentage(makePercentage(jykUnsatisfiedCount, jykAssessmentCount));
|
|
|
+ result.setSfckUnsatisfiedPercentage(makePercentage(sfckUnsatisfiedCount, sfckAssessmentCount));
|
|
|
+ result.setMzyhUnsatisfiedPercentage(makePercentage(mzyhUnsatisfiedCount, mzyhAssessmentCount));
|
|
|
+ result.setJzyhUnsatisfiedPercentage(makePercentage(jzyhUnsatisfiedCount, jzyhAssessmentCount));
|
|
|
+ result.setYjkUnsatisfiedOption(fillOptionDetails(yjkAssessmentCount, yjkCheckedOptionsCount, yjkOptionsJson, false));
|
|
|
+ result.setFskUnsatisfiedOption(fillOptionDetails(fskAssessmentCount, fskCheckedOptionsCount, fskOptionsJson, false));
|
|
|
+ result.setCsyxkUnsatisfiedOption(fillOptionDetails(csyxkAssessmentCount, csyxkCheckedOptionsCount, csyxkOptionsJson, false));
|
|
|
+ result.setJykUnsatisfiedOption(fillOptionDetails(jykAssessmentCount, jykCheckedOptionsCount, jykOptionsJson, false));
|
|
|
+ result.setSfckUnsatisfiedOption(fillOptionDetails(sfckAssessmentCount, sfckCheckedOptionsCount, sfckOptionsJson, false));
|
|
|
+ result.setMzyhUnsatisfiedOption(fillOptionDetails(mzyhAssessmentCount, mzyhCheckedOptionsCount, mzyhOptionsJson, true));
|
|
|
+ result.setJzyhUnsatisfiedOption(fillOptionDetails(jzyhAssessmentCount, jzyhCheckedOptionsCount, jzyhOptionsJson, false));
|
|
|
|
|
|
return ResultVoUtil.success(result);
|
|
|
}
|
|
|
|
|
|
- private UnsatisfiedOption fillOptionDetails(int optionsCount, JSONObject optionsJson, boolean isOptions2) {
|
|
|
+ private UnsatisfiedOption fillOptionDetails(int assessmentCount, int checkedOptionSize,
|
|
|
+ JSONObject optionsJson, boolean isOptions2) {
|
|
|
UnsatisfiedOption unsatisfiedOption = new UnsatisfiedOption();
|
|
|
- unsatisfiedOption.setTotalOptionSize(optionsCount);
|
|
|
+ int totalOptionSize = assessmentCount * (isOptions2 ? 6 : 7);
|
|
|
+ unsatisfiedOption.setTotalOptionSize(totalOptionSize);
|
|
|
+ unsatisfiedOption.setCheckedOptionSize(checkedOptionSize);
|
|
|
+ unsatisfiedOption.setCheckedOptionPercentage(makePercentage(checkedOptionSize, totalOptionSize));
|
|
|
unsatisfiedOption.setFwtdCount(optionsJson.getInteger("C"));
|
|
|
- unsatisfiedOption.setFwtdPercentage(makePercentage(unsatisfiedOption.getFwtdCount(), optionsCount));
|
|
|
+ unsatisfiedOption.setFwtdPercentage(makePercentage(unsatisfiedOption.getFwtdCount(), checkedOptionSize));
|
|
|
unsatisfiedOption.setGtjsCount(optionsJson.getInteger("D"));
|
|
|
- unsatisfiedOption.setGtjsPercentage(makePercentage(unsatisfiedOption.getGtjsCount(), optionsCount));
|
|
|
+ unsatisfiedOption.setGtjsPercentage(makePercentage(unsatisfiedOption.getGtjsCount(), checkedOptionSize));
|
|
|
unsatisfiedOption.setFzlyCount(optionsJson.getInteger("F"));
|
|
|
- unsatisfiedOption.setFzlyPercentage(makePercentage(unsatisfiedOption.getFzlyCount(), optionsCount));
|
|
|
+ unsatisfiedOption.setFzlyPercentage(makePercentage(unsatisfiedOption.getFzlyCount(), checkedOptionSize));
|
|
|
if (isOptions2) {
|
|
|
unsatisfiedOption.setJsspCount(optionsJson.getInteger("A"));
|
|
|
- unsatisfiedOption.setJsspPercentage(makePercentage(unsatisfiedOption.getJsspCount(), optionsCount));
|
|
|
+ unsatisfiedOption.setJsspPercentage(makePercentage(unsatisfiedOption.getJsspCount(), checkedOptionSize));
|
|
|
unsatisfiedOption.setYsbhCount(optionsJson.getInteger("B"));
|
|
|
- unsatisfiedOption.setYsbhPercentage(makePercentage(unsatisfiedOption.getYsbhCount(), optionsCount));
|
|
|
+ unsatisfiedOption.setYsbhPercentage(makePercentage(unsatisfiedOption.getYsbhCount(), checkedOptionSize));
|
|
|
unsatisfiedOption.setAszzCount(optionsJson.getInteger("E"));
|
|
|
- unsatisfiedOption.setAszzPercentage(makePercentage(unsatisfiedOption.getAszzCount(), optionsCount));
|
|
|
+ unsatisfiedOption.setAszzPercentage(makePercentage(unsatisfiedOption.getAszzCount(), checkedOptionSize));
|
|
|
} else {
|
|
|
unsatisfiedOption.setJhfwCount(optionsJson.getInteger("A"));
|
|
|
- unsatisfiedOption.setJhfwPercentage(makePercentage(unsatisfiedOption.getJhfwCount(), optionsCount));
|
|
|
+ unsatisfiedOption.setJhfwPercentage(makePercentage(unsatisfiedOption.getJhfwCount(), checkedOptionSize));
|
|
|
unsatisfiedOption.setDdscCount(optionsJson.getInteger("B"));
|
|
|
- unsatisfiedOption.setDdscPercentage(makePercentage(unsatisfiedOption.getDdscCount(), optionsCount));
|
|
|
+ unsatisfiedOption.setDdscPercentage(makePercentage(unsatisfiedOption.getDdscCount(), checkedOptionSize));
|
|
|
unsatisfiedOption.setJsxyCount(optionsJson.getInteger("E"));
|
|
|
- unsatisfiedOption.setJsxyPercentage(makePercentage(unsatisfiedOption.getJsxyCount(), optionsCount));
|
|
|
+ unsatisfiedOption.setJsxyPercentage(makePercentage(unsatisfiedOption.getJsxyCount(), checkedOptionSize));
|
|
|
unsatisfiedOption.setZqlCount(optionsJson.getInteger("G"));
|
|
|
- unsatisfiedOption.setZqlPercentage(makePercentage(unsatisfiedOption.getZqlCount(), optionsCount));
|
|
|
+ unsatisfiedOption.setZqlPercentage(makePercentage(unsatisfiedOption.getZqlCount(), checkedOptionSize));
|
|
|
}
|
|
|
return unsatisfiedOption;
|
|
|
}
|
|
|
|
|
|
- private int getOptionsCount(int optionsCount, JSONObject optionsJson, String options) {
|
|
|
+ private int getCheckedOptionsCount(int optionsCount, JSONObject optionsJson, String options) {
|
|
|
if (StringUtil.notBlank(options)) {
|
|
|
String[] arr = options.split("\\^");
|
|
|
optionsCount += arr.length;
|