|
@@ -29,6 +29,7 @@ import javax.validation.Valid;
|
29
|
29
|
import java.util.ArrayList;
|
30
|
30
|
import java.util.Arrays;
|
31
|
31
|
import java.util.List;
|
|
32
|
+import java.util.Objects;
|
32
|
33
|
|
33
|
34
|
/**
|
34
|
35
|
* DiagnosisTypeController
|
|
@@ -109,6 +110,15 @@ public class DiagnosisTypeController extends BaseController {
|
109
|
110
|
if (count > 0) {
|
110
|
111
|
return error("不允许添加子集");
|
111
|
112
|
}
|
|
113
|
+ DiagnosisType type = diagnosisTypeService.getById(diagnosisType.getParentId());
|
|
114
|
+ if (Objects.nonNull(type)) {
|
|
115
|
+ if(StringUtils.isNotBlank(type.getAncestors()) && type.getAncestors().split(",").length > 4){
|
|
116
|
+ return error("不允许继续添加子集");
|
|
117
|
+ }
|
|
118
|
+ diagnosisType.setAncestors(type.getAncestors() + "," + diagnosisType.getParentId());
|
|
119
|
+ } else {
|
|
120
|
+ diagnosisType.setAncestors(diagnosisType.getParentId());
|
|
121
|
+ }
|
112
|
122
|
return toAjax(diagnosisTypeService.save(diagnosisType));
|
113
|
123
|
}
|
114
|
124
|
|