|
|
@@ -118,8 +118,8 @@ public class PatientLabelController extends BaseController {
|
|
118
|
118
|
//@PathVariable String[] patientids, @PathVariable String labelname) {
|
|
119
|
119
|
{
|
|
120
|
120
|
List<String> patientids = new ArrayList<>();
|
|
121
|
|
-
|
|
122
|
|
- if (input.getPatientids() != null && input.getPatientids().size()>0) {
|
|
|
121
|
+ if (input.getPatientids() != null && input.getPatientids().stream().count()>0) {
|
|
|
122
|
+ // if (input.getPatientids() != null && input.getPatientids().size()>0) {
|
|
123
|
123
|
patientids = input.getPatientids();
|
|
124
|
124
|
}
|
|
125
|
125
|
LambdaQueryWrapper<PatientLabel> lp = new LambdaQueryWrapper<>();
|
|
|
@@ -151,13 +151,27 @@ public class PatientLabelController extends BaseController {
|
|
151
|
151
|
|
|
152
|
152
|
public AjaxResult batchadd(@RequestBody LabelInput inputlabel) {
|
|
153
|
153
|
Label labelmodel=new Label();
|
|
154
|
|
- if(inputlabel.getLabelId()!=null && inputlabel.getLabelId()>0){}
|
|
|
154
|
+
|
|
|
155
|
+ Long labelid;
|
|
|
156
|
+ //判断标签是否存在
|
|
|
157
|
+ LambdaQueryWrapper<Label> lqw=new LambdaQueryWrapper<>();
|
|
|
158
|
+ lqw.eq(Label::getLabelName,inputlabel.getLabelName());
|
|
|
159
|
+ List<Label> labelList=labelService.getList(lqw);
|
|
|
160
|
+ if(labelList.size()>0){
|
|
|
161
|
+ labelmodel=labelList.get(0);
|
|
|
162
|
+ labelid=labelmodel.getLabelId();
|
|
|
163
|
+
|
|
|
164
|
+ labelmodel.setPatientCount(inputlabel.getPatientids().stream().count()+labelmodel.getPatientCount());
|
|
|
165
|
+ labelService.update(labelmodel);
|
|
|
166
|
+
|
|
|
167
|
+ }
|
|
155
|
168
|
else{
|
|
156
|
169
|
//先添加标签
|
|
157
|
170
|
labelmodel.setLabelName(inputlabel.getLabelName());
|
|
158
|
171
|
labelmodel.setPatientCount(inputlabel.getPatientids().stream().count());
|
|
159
|
172
|
labelmodel.setCreateUser(CurrentUser().getUserName());
|
|
160
|
173
|
labelService.insert(labelmodel);
|
|
|
174
|
+ labelid=labelmodel.getLabelId();
|
|
161
|
175
|
}
|
|
162
|
176
|
|
|
163
|
177
|
Date currentDate = new Date(System.currentTimeMillis());
|
|
|
@@ -166,7 +180,7 @@ public class PatientLabelController extends BaseController {
|
|
166
|
180
|
lp.in(Patient::getPatientId,inputlabel.getPatientids());
|
|
167
|
181
|
List<Patient> patientList= patientService.getList(lp);
|
|
168
|
182
|
|
|
169
|
|
- Long labelid=inputlabel.getLabelId()==null?labelmodel.getLabelId():inputlabel.getLabelId();
|
|
|
183
|
+ // Long labelid=inputlabel.getLabelId()==null?labelmodel.getLabelId():inputlabel.getLabelId();
|
|
170
|
184
|
|
|
171
|
185
|
StringBuilder error = new StringBuilder();
|
|
172
|
186
|
for (int i = 0; i < patientids.stream().count(); i++) {
|