Browse Source

Merge branch 'dev' of lyr/patient-co-management into dev

lyr 8 years ago
parent
commit
788279ba2a

+ 37 - 1
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/label/SignPatientLabelInfoService.java

@ -186,7 +186,7 @@ public class SignPatientLabelInfoService extends BaseService {
     * @return
     * @throws Exception
     */
    public JSONArray getPatientByTeamCode(String doctor, long teamCode, int page, int pagesize) throws Exception {
    public JSONArray getPatientByTeamCode(String doctor, long teamCode, String exLabelCode, String exLabelType, int page, int pagesize) throws Exception {
        Doctor doc = doctorDao.findByCode(doctor);
        if (doc == null) {
@ -226,6 +226,20 @@ public class SignPatientLabelInfoService extends BaseService {
                    continue;
                }
                if (StringUtils.isNotEmpty(exLabelCode)) {
                    SignPatientLabelInfo labelInfoEx = labelInfoDao.findByPatientAndLabelAndLabelTypeAndStatus(p.getCode(), exLabelCode, exLabelType, 1);
                    if (labelInfoEx != null) {
                        continue;
                    }
                } else if (StringUtils.isNotEmpty(exLabelType)) {
                    List<SignPatientLabelInfo> labelExs = labelInfoDao.findByPatientAndLabelTypeAndStatus(p.getCode(), exLabelType, 1);
                    if (labelExs != null && labelExs.size() > 0) {
                        continue;
                    }
                }
                List<SignPatientLabelInfo> labels = labelInfoDao.findByPatientAndStatus(sign.get("patient").toString(), 1);
                JSONObject json = new JSONObject();
@ -562,6 +576,8 @@ public class SignPatientLabelInfoService extends BaseService {
     */
    public JSONArray searchPatientByNameOrLabel(String doctor, String filter,
                                                String labelCode, String labelType, long teamCode,
                                                String exLabelCode,
                                                String exLabelType,
                                                int page, int pagesize) throws Exception {
        Doctor doc = doctorDao.findByCode(doctor);
@ -610,7 +626,27 @@ public class SignPatientLabelInfoService extends BaseService {
                    continue;
                }
                if (StringUtils.isNotEmpty(exLabelCode)) {
                    SignPatientLabelInfo labelInfoEx = labelInfoDao.findByPatientAndLabelAndLabelTypeAndStatus(p.getCode(), exLabelCode, exLabelType, 1);
                    if (labelInfoEx != null) {
                        continue;
                    }
                } else if (StringUtils.isNotEmpty(exLabelType)) {
                    List<SignPatientLabelInfo> labelExs = labelInfoDao.findByPatientAndLabelTypeAndStatus(p.getCode(), exLabelType, 1);
                    if (labelExs != null && labelExs.size() > 0) {
                        continue;
                    }
                }
                List<SignPatientLabelInfo> labels = labelInfoDao.findByPatientAndStatus(sign.get("patient").toString(), 1);
                if (StringUtils.isEmpty(exLabelCode) || StringUtils.isEmpty(exLabelType)) {
                }
                JSONObject json = new JSONObject();
                // 设置患者标识

+ 21 - 7
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/patient/SignPatientLabelInfoController.java

@ -65,14 +65,21 @@ public class SignPatientLabelInfoController extends BaseController {
     * @return
     */
    @RequestMapping(value = "/patients_by_team")
    public String getPatientInfoByTeam(Long teamCode,int page,int pagesize){
    public String getPatientInfoByTeam(Long teamCode,
                                       @RequestParam(required = false) String exLabelCode,
                                       @RequestParam(required = false) String exLabelType,
                                       int page, int pagesize) {
        try {
            if (teamCode == null || teamCode < 1) {
                return error(-1, "团队cdoe不能为空");
            }
            if (!StringUtils.isEmpty(exLabelCode) && StringUtils.isEmpty(exLabelType)) {
                return error(-1, "过滤标签参数不为空时过滤标签类型不能为空");
            }
            page = page - 1;
            JSONArray result = labelInfoService.getPatientByTeamCode(getUID(), teamCode, page, pagesize);
            JSONArray result = labelInfoService.getPatientByTeamCode(getUID(), teamCode, exLabelCode,exLabelType,page, pagesize);
            return write(200, "查询成功", "data", result);
        } catch (Exception e) {
@ -177,10 +184,13 @@ public class SignPatientLabelInfoController extends BaseController {
     * @return
     */
    @RequestMapping(value = "/patient_search")
    public String searchPatientByNameOrLabel(String filter, @RequestParam(required = false)String labelCode,
                                             @RequestParam(required = false)String labelType,
    public String searchPatientByNameOrLabel(String filter,
                                             @RequestParam(required = false) String labelCode,
                                             @RequestParam(required = false) String labelType,
                                             @RequestParam(required = false) Long teamCode,
                                             int page,int pagesize) {
                                             @RequestParam(required = false) String exLabelCode,
                                             @RequestParam(required = false) String exLabelType,
                                             int page, int pagesize) {
        try {
            if (StringUtils.isEmpty(filter)) {
                return error(-1, "搜索字段不能为空");
@ -190,13 +200,17 @@ public class SignPatientLabelInfoController extends BaseController {
                return error(-1, "标签参数不为空时标签类型不能为空");
            }
            if(teamCode == null){
            if (!StringUtils.isEmpty(exLabelCode) && StringUtils.isEmpty(exLabelType)) {
                return error(-1, "过滤标签参数不为空时过滤标签类型不能为空");
            }
            if (teamCode == null) {
                teamCode = 0L;
            }
            page = page - 1;
            JSONArray result = labelInfoService.searchPatientByNameOrLabel(getUID(), filter, labelCode, labelType,teamCode,page,pagesize);
            JSONArray result = labelInfoService.searchPatientByNameOrLabel(getUID(), filter, labelCode, labelType, teamCode, exLabelCode, exLabelType, page, pagesize);
            return write(200, "查询成功", "data", result);
        } catch (Exception e) {