|
@ -1,7 +1,9 @@
|
|
|
package com.yihu.wlyy.web.doctor.concern;
|
|
|
|
|
|
import com.yihu.wlyy.entity.concern.ConcernDO;
|
|
|
import com.yihu.wlyy.entity.patient.Patient;
|
|
|
import com.yihu.wlyy.service.app.concern.ConcernService;
|
|
|
import com.yihu.wlyy.service.common.account.PatientService;
|
|
|
import com.yihu.wlyy.util.DateUtil;
|
|
|
import com.yihu.wlyy.util.IdCardUtil;
|
|
|
import com.yihu.wlyy.web.BaseController;
|
|
@ -28,6 +30,8 @@ import java.util.List;
|
|
|
public class DoctorConcernController extends BaseController {
|
|
|
@Autowired
|
|
|
private ConcernService concernService;
|
|
|
@Autowired
|
|
|
private PatientService patientService;
|
|
|
|
|
|
@RequestMapping(value = "/getConcernPatients", method = RequestMethod.GET)
|
|
|
@ApiOperation(value = "获取医生关注的患者", notes = "", response = Patient.class)
|
|
@ -50,6 +54,7 @@ public class DoctorConcernController extends BaseController {
|
|
|
jsonObject.put("photo", patient.getPhoto());
|
|
|
jsonObject.put("sex", patient.getSex());
|
|
|
jsonObject.put("phone", patient.getPhone());
|
|
|
jsonObject.put("address", patient.getAddress());
|
|
|
jsonObject.put("age", IdCardUtil.getAgeForIdcard(patient.getIdcard()));
|
|
|
jsonObject.put("isWX", StringUtils.isEmpty(patient.getOpenid()) ? false : true);
|
|
|
jsonObject.put("concernTime", DateUtil.dateToStr(patient.getConcernCreateTime(), "yyyy-MM-dd HH:mm:ss"));
|
|
@ -88,4 +93,34 @@ public class DoctorConcernController extends BaseController {
|
|
|
return error(-100, "查询失败");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@RequestMapping(value = "/findByCode", method = RequestMethod.GET)
|
|
|
@ApiOperation(value = "获取关注详细信息", notes = "")
|
|
|
public String findByCode(
|
|
|
@ApiParam(name = "concernCode", value = "关注code", required = true) @RequestParam(required = true, name = "concernCode") String concernCode
|
|
|
|
|
|
) {
|
|
|
try {
|
|
|
ConcernDO concernDO= concernService.findByCode(concernCode);
|
|
|
Patient patient=patientService.findByCode(concernDO.getPatient());
|
|
|
|
|
|
JSONObject jsonObject = new JSONObject();
|
|
|
jsonObject.put("code", patient.getCode());//患者code
|
|
|
jsonObject.put("name", patient.getName());//患者名称
|
|
|
jsonObject.put("photo", patient.getPhoto());//患者头像
|
|
|
jsonObject.put("sex", patient.getSex());//患者性别
|
|
|
jsonObject.put("phone", patient.getPhone());//患者电话
|
|
|
jsonObject.put("idcard", patient.getIdcard());//患者身份证
|
|
|
jsonObject.put("address", patient.getAddress());//患者详细地址
|
|
|
jsonObject.put("age", IdCardUtil.getAgeForIdcard(patient.getIdcard()));//患者年龄
|
|
|
jsonObject.put("isWX", StringUtils.isEmpty(patient.getOpenid()) ? false : true);//是否关注微信
|
|
|
jsonObject.put("concernType", concernDO.getConcernSource());//关注类型
|
|
|
jsonObject.put("concernTime", DateUtil.dateToStr(concernDO.getCreateTime(), "yyyy-MM-dd HH:mm:ss"));//关注事件
|
|
|
|
|
|
return write(200, "查询成功", "data", jsonObject);
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
return error(-100, "查询失败");
|
|
|
}
|
|
|
}
|
|
|
}
|