Pārlūkot izejas kodu

Merge branch 'srdev' of chenweida/patient-co-management into srdev

chenweida 7 gadi atpakaļ
vecāks
revīzija
a703f4148c

+ 22 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/concern/PatientConcernController.java

@ -1,11 +1,17 @@
package com.yihu.wlyy.web.patient.concern;
package com.yihu.wlyy.web.patient.concern;
import com.yihu.wlyy.entity.doctor.profile.Doctor;
import com.yihu.wlyy.entity.patient.Patient;
import com.yihu.wlyy.service.app.concern.ConcernService;
import com.yihu.wlyy.service.app.concern.ConcernService;
import com.yihu.wlyy.util.DateUtil;
import com.yihu.wlyy.util.IdCardUtil;
import com.yihu.wlyy.web.BaseController;
import com.yihu.wlyy.web.BaseController;
import com.yihu.wlyy.web.WeixinBaseController;
import com.yihu.wlyy.web.WeixinBaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import io.swagger.annotations.ApiParam;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.stereotype.Controller;
import org.springframework.util.StringUtils;
import org.springframework.util.StringUtils;
@ -14,6 +20,8 @@ import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
/**
 * Created by Administrator on 2018/4/4 0004.
 * Created by Administrator on 2018/4/4 0004.
 */
 */
@ -72,7 +80,20 @@ public class PatientConcernController extends BaseController {
            if (StringUtils.isEmpty(patient)) {
            if (StringUtils.isEmpty(patient)) {
                patient = getUID();
                patient = getUID();
            }
            }
            return write(200, "查询成功", "data", concernService.listDoctorsByPatientCode(patient));
            JSONArray array = new JSONArray();
            List<Doctor> doctors=concernService.listDoctorsByPatientCode(patient);
            for (Doctor doctor : doctors) {
                JSONObject jsonObject = new JSONObject();
                jsonObject.put("code", doctor.getCode());
                jsonObject.put("name", doctor.getName());
                jsonObject.put("photo", doctor.getPhoto());
                jsonObject.put("sex", doctor.getSex());
                jsonObject.put("age", IdCardUtil.getAgeForIdcard(doctor.getIdcard()));
                array.add(jsonObject);
            }
            return write(200, "查询成功", "data", array);
        } catch (Exception e) {
        } catch (Exception e) {
            e.printStackTrace();
            e.printStackTrace();
            return error(-100, "查询失败");
            return error(-100, "查询失败");