|
@ -1,7 +1,9 @@
|
|
|
package com.yihu.wlyy.web.doctor.patient;
|
|
|
|
|
|
import com.yihu.wlyy.entity.doctor.team.admin.AdminTeam;
|
|
|
import com.yihu.wlyy.entity.doctor.team.sign.SignPatientLabel;
|
|
|
import com.yihu.wlyy.service.app.label.SignPatientLabelService;
|
|
|
import com.yihu.wlyy.service.app.team.AdminTeamService;
|
|
|
import com.yihu.wlyy.web.BaseController;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.json.JSONArray;
|
|
@ -9,8 +11,10 @@ import org.json.JSONObject;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
|
import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
|
|
|
/**
|
|
@ -24,6 +28,8 @@ public class SignPatientLabelController extends BaseController {
|
|
|
|
|
|
@Autowired
|
|
|
SignPatientLabelService labelService;
|
|
|
@Autowired
|
|
|
AdminTeamService teamService;
|
|
|
|
|
|
/**
|
|
|
* 添加标签
|
|
@ -236,4 +242,34 @@ public class SignPatientLabelController extends BaseController {
|
|
|
return error(-1, "查询失败");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@RequestMapping(value = "/patient_teams")
|
|
|
public String getTeamsLabelsByPatient(@RequestParam String patient) {
|
|
|
try {
|
|
|
if (StringUtils.isEmpty(patient)) {
|
|
|
return error(-1, "居民不能为空");
|
|
|
}
|
|
|
|
|
|
JSONArray teams = teamService.findPatientDoctorTeam(patient, getUID());
|
|
|
|
|
|
if(teams != null && teams.length() > 0){
|
|
|
for(int i = 0; i < teams.length(); i++){
|
|
|
JSONObject team = teams.getJSONObject(i);
|
|
|
List<SignPatientLabel> labels = labelService.getLabelsByTypeAndTeam("4", String.valueOf(team.getLong("id")));
|
|
|
|
|
|
if(labels != null){
|
|
|
team.put("labels",new JSONArray(labels));
|
|
|
} else {
|
|
|
team.put("labels",new JSONArray());
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
return write(200, "查询成功", "data", teams);
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
return error(-1, "查询失败");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
}
|