|
@ -5,6 +5,7 @@ import com.yihu.wlyy.entity.Patient;
|
|
|
import com.yihu.wlyy.entity.User;
|
|
|
import com.yihu.wlyy.entity.WlyyCustomerLog;
|
|
|
import com.yihu.wlyy.repository.ManageDictDao;
|
|
|
import com.yihu.wlyy.repository.PatientDao;
|
|
|
import com.yihu.wlyy.service.manager.account.CustomerService;
|
|
|
import com.yihu.wlyy.service.manager.family.FamilyMemberService;
|
|
|
import com.yihu.wlyy.service.manager.patient.AdminPatientService;
|
|
@ -19,6 +20,8 @@ import org.springframework.web.bind.annotation.*;
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
import java.util.Date;
|
|
|
import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
|
|
|
/**
|
|
@ -47,6 +50,10 @@ public class CustomerController extends BaseController {
|
|
|
@Autowired
|
|
|
private WlyyCustomerLogService wlyyCustomerLogService;
|
|
|
|
|
|
@Autowired
|
|
|
private PatientDao patientDao;
|
|
|
|
|
|
|
|
|
@RequestMapping(value = "/login",method = RequestMethod.POST,produces="application/json;charset=UTF-8")
|
|
|
@ResponseBody
|
|
|
public String login(@ApiParam(name = "userName", value = "账号", required = true)@RequestParam(required = true, name = "userName") String userName,
|
|
@ -126,6 +133,7 @@ public class CustomerController extends BaseController {
|
|
|
}
|
|
|
Map<String, Object> resp = customerService.findServerInfo(patient);
|
|
|
resp.put("patient",patient);
|
|
|
|
|
|
return write(200,"查询成功","data",resp);
|
|
|
}
|
|
|
|
|
@ -137,13 +145,33 @@ public class CustomerController extends BaseController {
|
|
|
@ResponseBody
|
|
|
public String findByMobile(@ApiParam(name = "mobile", value = "手机号", required = false)@RequestParam(required = true, name = "mobile") String mobile) throws Exception {
|
|
|
|
|
|
Map<String, Object> resp = new HashMap<>();
|
|
|
|
|
|
//根据条件查询病人信息
|
|
|
Patient patient = patientService.findByMobile(mobile);
|
|
|
if(patient ==null){
|
|
|
List<Patient> patients = patientService.findByMobile(mobile);
|
|
|
if(patients ==null || patients.size()==0){
|
|
|
return write(-1,"未查询到");
|
|
|
}else if(patients.size()==1){
|
|
|
Patient patient = patients.get(0);
|
|
|
resp = customerService.findServerInfo(patients.get(0));
|
|
|
resp.put("patient",patient);
|
|
|
return write(200,"查询成功","data",resp);
|
|
|
}
|
|
|
Map<String, Object> resp = customerService.findServerInfo(patient);
|
|
|
resp.put("patient",patient);
|
|
|
resp.put("patients",patients);
|
|
|
return write(200,"查询成功","data",resp);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
*通过居民code,查找家庭关系,签约信息,医生等
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value = "/findByPatient",produces="application/json;charset=UTF-8")
|
|
|
@ResponseBody
|
|
|
public String findByPatient(@ApiParam(name = "patientCode", value = "居民code", required = false)@RequestParam(required = true, name = "patientCode") String patientCode) throws Exception {
|
|
|
Patient patient = patientDao.findByCode(patientCode);
|
|
|
Map<String, Object> respon = customerService.findServerInfo(patientCode);
|
|
|
respon.put("patient",patient);
|
|
|
return write(200,"查询成功","data",respon);
|
|
|
}
|
|
|
|
|
|
}
|